Lines Matching defs:key
51 const Key& key() const { return this->first; }
69 const Value& Get(const Key& key) const {
70 HashValue key_hash = HashValue(Hasher()(key));
72 return GetFocusedValue(tree, key);
75 // Add or overwrite an existing key-value pair.
76 void Set(Key key, Value value);
91 // The iterator produces key-value pairs in the lexicographical order of
92 // hash value and key. It produces exactly the key-value pairs where the value
103 // for each key where at least one value is different from the respective
121 // Find the {FocusedTree} that contains a key-value pair with key hash {hash}.
124 // Find the {FocusedTree} that contains a key-value pair with key hash {hash}.
134 const Value& GetFocusedValue(const FocusedTree* tree, const Key& key) const;
158 // leaf. For the focused leaf, it stores key, value and key hash. The path is
378 void PersistentMap<Key, Value, Hasher>::Set(Key key, Value value) {
379 HashValue key_hash = HashValue(Hasher()(key));
384 if (!(GetFocusedValue(old, key) != value)) return;
385 if (old && !(old->more == nullptr && old->key_value.key() == key)) {
390 more->erase(old->key_value.key());
391 more->emplace(old->key_value.key(), old->key_value.value());
393 more->erase(key);
394 more->emplace(key, value);
399 FocusedTree{KeyValue(std::move(key), std::move(value)),
454 const FocusedTree* tree, const Key& key) const {
459 auto it = tree->more->find(key);
465 if (key == tree->key_value.key()) {