2017
[folly.git] / folly / test / AsciiCaseInsensitiveBenchmark.cpp
index 20aee3f528af6306622ee2b9916b9ec83282dbc4..b1f9142e89e101a1648182d65e18299dcbd161c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ string lorem_ipsum =
 "vulputate quam urna quis eros. Donec vel."
 "\n";
 
-string needle = "commodo";
+const string needle = "commodo";
 
 // legacy implementation
 struct AsciiCaseInsensitiveLegacy {
@@ -100,6 +100,7 @@ inline void test_operator_on_search(int iters) {
       cmp
     ) - lorem_ipsum.begin();
   }
+  doNotOptimizeAway(dummy);
 }
 
 BENCHMARK(LegacyCaseInsensitiveCheck, iters) {