| 277 | } |
| 278 | |
| 279 | void Executor::NodeInfo::addSubNode(RNode* s) { |
| 280 | CHECK_NOTNULL(s); |
| 281 | // insert s into sub_nodes such as sub_nodes is still ordered |
| 282 | int pos = 0; |
| 283 | while (pos < sub_nodes.size() && |
| 284 | CHECK_NOTNULL(sub_nodes[pos])->keyRange().inLeft(s->keyRange())) { |
| 285 | ++ pos; |
| 286 | } |
| 287 | sub_nodes.insert(sub_nodes.begin()+pos, s); |
| 288 | // update the key range |
| 289 | key_ranges.insert(key_ranges.begin() + pos, s->keyRange()); |
| 290 | } |
| 291 | |
| 292 | void Executor::NodeInfo::removeSubNode(RNode* s) { |
| 293 | size_t n = sub_nodes.size(); |