MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / up

Method up

thread/thread.cpp:436–453  ·  view source on GitHub ↗

compare m_nodes[idx] with parent node.

Source from the content-addressed store, hash-verified

434
435 // compare m_nodes[idx] with parent node.
436 bool up(int idx)
437 {
438 assert(!q.empty());
439 auto tmp = q[idx];
440 bool ret = false;
441 while (idx != 0){
442 auto cmpIdx = (idx - 1) >> 1;
443 if (*tmp < *q[cmpIdx]) {
444 update_node(idx, q[cmpIdx]);
445 idx = cmpIdx;
446 ret = true;
447 continue;
448 }
449 break;
450 }
451 if (ret) update_node(idx, tmp);
452 return ret;
453 }
454
455 // compare m_nodes[idx] with child node.
456 bool down(int idx)

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected