Home | History | Annotate | Download | only in src

Lines Matching refs:Key

72 bool ZoneSplayTree<C>::Insert(const Key& key, Locator* locator) {
75 root_ = new Node(key, C::kNoValue);
77 // Splay on the key to move the last node on the search path
78 // for the key to the root of the tree.
79 Splay(key);
80 // Ignore repeated insertions with the same key.
81 int cmp = C::Compare(key, root_->key_);
87 Node* node = new Node(key, C::kNoValue);
105 bool ZoneSplayTree<C>::Find(const Key& key, Locator* locator) {
108 Splay(key);
109 if (C::Compare(key, root_->key_) == 0) {
119 bool ZoneSplayTree<C>::FindGreatestLessThan(const Key& key,
123 // Splay on the key to move the node with the given key or the last
125 Splay(key);
128 int cmp = C::Compare(root_->key_, key);
143 bool ZoneSplayTree<C>::FindLeastGreaterThan(const Key& key,
147 // Splay on the key to move the node with the given key or the last
149 Splay(key);
152 int cmp = C::Compare(root_->key_, key);
191 bool ZoneSplayTree<C>::Remove(const Key& key) {
195 // Splay on the key to move the node with the given key to the top.
196 Splay(key);
197 // Bail if the key is not in the tree
198 if (C::Compare(key, root_->key_) != 0)
209 Splay(key);
219 void ZoneSplayTree<C>::Splay(const Key& key) {
233 int cmp = C::Compare(key, current->key_);
237 if (C::Compare(key, current->left_->key_) < 0) {
253 if (C::Compare(key, current->right_->key_) > 0) {
288 callback->Call(node->key(), node->value());