Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: src/splay-tree.h

Issue 910002: Start migrating profiles processing to C++. (Closed)
Patch Set: Comments addressed Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/splay-tree.h
diff --git a/src/splay-tree.h b/src/splay-tree.h
index b0f415d827eb50daca800f6381e3e031552b629c..c265276003e3d03a9934f2822e81a4b2cdf6db73 100644
--- a/src/splay-tree.h
+++ b/src/splay-tree.h
@@ -88,6 +88,9 @@ class SplayTree {
// Find the mapping with the least key in this tree.
bool FindLeast(Locator* locator);
+ // Move the node from one key to another.
+ bool Move(const Key& old_key, const Key& new_key);
+
// Remove the node with the given key from the tree.
bool Remove(const Key& key);
@@ -151,6 +154,15 @@ class SplayTree {
void ResetRoot() { root_ = NULL; }
private:
+ // Search for a node with a given key. If found, root_ points
+ // to the node.
+ bool FindInternal(const Key& key);
+
+ // Inserts a node assuming that root_ is already set up.
+ void InsertInternal(int cmp, Node* node);
+
+ // Removes root_ node.
+ void RemoveRootNode(const Key& key);
template<class Callback>
class NodeToPairAdaptor BASE_EMBEDDED {

Powered by Google App Engine
This is Rietveld 408576698