Conversions between numeric keys/values and the types expected by Cache.
| 12 | |
| 13 | // Conversions between numeric keys/values and the types expected by Cache. |
| 14 | static std::string EncodeKey(int k) { |
| 15 | std::string result; |
| 16 | PutFixed32(&result, k); |
| 17 | return result; |
| 18 | } |
| 19 | static int DecodeKey(const Slice& k) { |
| 20 | assert(k.size() == 4); |
| 21 | return DecodeFixed32(k.data()); |
no test coverage detected