MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / find_

Method find_

libCacheSim/dataStructure/splaytree.hpp:431–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429
430template <typename K, typename V>
431typename SplayTree<K, V>::node *SplayTree<K, V>::find_(const K &key)
432{
433 node *p = root_.get();
434 while (p)
435 {
436 if (key < p->first)
437 p = p->left.get();
438 else if (key > p->first)
439 p = p->right.get();
440 else
441 {
442 splay(p);
443 return root_.get();
444 }
445 }
446 return nullptr;
447}
448
449template <typename K, typename V>
450void SplayTree<K, V>::remove(node *n)

Callers

nothing calls this directly

Calls 2

splayFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected