MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / __pushup

Function __pushup

src/util/heap.c:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static int __pushup
56(
57 heap_t *hp,
58 unsigned int idx
59) {
60 // 0 is the root node
61 while (0 != idx)
62 {
63 int parent = __parent(idx);
64
65 // we are smaller than the parent
66 if(hp->cmp(hp->array[idx], hp->array[parent], hp->udata) < 0) {
67 return -1;
68 } else {
69 __swap(hp, idx, parent);
70 }
71
72 idx = parent;
73 }
74
75 return idx;
76}
77
78static void __pushdown
79(

Callers 2

__Heap_offerxFunction · 0.85
Heap_remove_itemFunction · 0.85

Calls 2

__parentFunction · 0.85
__swapFunction · 0.85

Tested by

no test coverage detected