| 81 | } |
| 82 | |
| 83 | int Lookup(int key) { |
| 84 | auto handle(cache_->Lookup(EncodeInt(key), Cache::EXPECT_IN_CACHE)); |
| 85 | return handle ? DecodeInt(cache_->Value(handle)) : -1; |
| 86 | } |
| 87 | |
| 88 | void Insert(int key, int value, int charge = 1) { |
| 89 | std::string key_str = EncodeInt(key); |