Mercurial > dedupe
comparison RBTree.hpp @ 22:d62f708ad88b
Cosmetics.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Wed, 05 Sep 2012 21:55:21 +0200 |
| parents | fcb7a71a22c1 |
| children | b2c2c2bf2bbd |
comparison
equal
deleted
inserted
replaced
| 21:3bcdb8bb6914 | 22:d62f708ad88b |
|---|---|
| 269 retVal = retVal && (right->parent == this) && right->consistent(); | 269 retVal = retVal && (right->parent == this) && right->consistent(); |
| 270 return retVal; | 270 return retVal; |
| 271 } | 271 } |
| 272 | 272 |
| 273 friend class RBTree; | 273 friend class RBTree; |
| 274 | |
| 275 }; | 274 }; |
| 275 | |
| 276 RBTreeNode* node; | 276 RBTreeNode* node; |
| 277 public: | 277 public: |
| 278 RBTree() : node(0) | 278 RBTree() : node(0) |
| 279 { | 279 { |
| 280 } | 280 } |
| 302 node->insert(data); | 302 node->insert(data); |
| 303 } | 303 } |
| 304 node = node->getRootNode(); | 304 node = node->getRootNode(); |
| 305 CONSISTENCY_CHECK(this); | 305 CONSISTENCY_CHECK(this); |
| 306 } | 306 } |
| 307 | |
| 307 boost::optional<Data> find(const Data& data) | 308 boost::optional<Data> find(const Data& data) |
| 308 { | 309 { |
| 309 if (node) { | 310 if (node) { |
| 310 return node->find(data); | 311 return node->find(data); |
| 311 } | 312 } |
