| 89 | BENCHMARK(LruCacheLookup)->Apply(SetCacheArgs); |
| 90 | |
| 91 | struct Callable { |
| 92 | explicit Callable(std::vector<std::string> values) |
| 93 | : index_(0), values_(std::move(values)) {} |
| 94 | |
| 95 | std::string operator()(const std::string& key) { |
| 96 | // Return a value unrelated to the key |
| 97 | if (++index_ >= static_cast<int64_t>(values_.size())) { |
| 98 | index_ = 0; |
| 99 | } |
| 100 | return values_[index_]; |
| 101 | } |
| 102 | |
| 103 | private: |
| 104 | int64_t index_; |
| 105 | std::vector<std::string> values_; |
| 106 | }; |
| 107 | |
| 108 | template <typename Memoized> |
| 109 | static void BenchmarkMemoize(benchmark::State& state, Memoized&& mem, |
no outgoing calls
no test coverage detected