Lines Matching refs:Key
22 bool SplayTree<Config, Allocator>::Insert(const Key& key,
26 root_ = new(allocator_) Node(key, Config::NoValue());
28 // Splay on the key to move the last node on the search path
29 // for the key to the root of the tree.
30 Splay(key);
31 // Ignore repeated insertions with the same key.
32 int cmp = Config::Compare(key, root_->key_);
38 Node* node = new(allocator_) Node(key, Config::NoValue());
62 bool SplayTree<Config, Allocator>::FindInternal(const Key& key) {
65 Splay(key);
66 return Config::Compare(key, root_->key_) == 0;
71 bool SplayTree<Config, Allocator>::Contains(const Key& key) {
72 return FindInternal(key);
77 bool SplayTree<Config, Allocator>::Find(const Key& key, Locator* locator) {
78 if (FindInternal(key)) {
88 bool SplayTree<Config, Allocator>::FindGreatestLessThan(const Key& key,
92 // Splay on the key to move the node with the given key or the last
94 Splay(key);
97 int cmp = Config::Compare(root_->key_, key);
112 bool SplayTree<Config, Allocator>::FindLeastGreaterThan(const Key& key,
116 // Splay on the key to move the node with the given key or the last
118 Splay(key);
121 int cmp = Config::Compare(root_->key_, key);
160 bool SplayTree<Config, Allocator>::Move(const Key& old_key,
161 const Key& new_key) {
169 // A node with the target key already exists.
180 bool SplayTree<Config, Allocator>::Remove(const Key& key) {
181 if (!FindInternal(key))
184 RemoveRootNode(key);
191 void SplayTree<Config, Allocator>::RemoveRootNode(const Key& key) {
201 Splay(key);
210 void SplayTree<Config, Allocator>::Splay(const Key& key) {
224 int cmp = Config::Compare(key, current->key_);
228 if (Config::Compare(key, current->left_->key_) < 0) {
244 if (Config::Compare(key, current->right_->key_) > 0) {