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

Function Heap_poll

src/util/heap.c:228–246  ·  view source on GitHub ↗

remove the item with the top priority return top item

Source from the content-addressed store, hash-verified

226// remove the item with the top priority
227// return top item
228void *Heap_poll
229(
230 heap_t *hp
231) {
232 if(0 == Heap_count(hp)) {
233 return NULL;
234 }
235
236 void *item = hp->array[0];
237
238 hp->array[0] = hp->array[hp->count - 1];
239 hp->count--;
240
241 if(hp->count > 1) {
242 __pushdown(hp, 0);
243 }
244
245 return item;
246}
247
248// return top item of the heap
249void *Heap_peek

Callers 15

clear_tasksFunction · 0.85
SlowLog_AddFunction · 0.85
SlowLog_ReplayFunction · 0.85
_accumulateFunction · 0.85
SortConsumeFunction · 0.85
SortResetFunction · 0.85
SortFreeFunction · 0.85
SPpaths_k_minimalFunction · 0.85
Proc_SPpathsStepFunction · 0.85
SSpaths_k_minimalFunction · 0.85
Proc_SSpathsStepFunction · 0.85
test_heapCreateFunction · 0.85

Calls 2

Heap_countFunction · 0.85
__pushdownFunction · 0.85

Tested by 6

test_heapCreateFunction · 0.68
test_heapPopulateFunction · 0.68
test_heapPopulateDupFunction · 0.68
test_heapPopulateRandFunction · 0.68
test_heapRemoveElementFunction · 0.68
test_heapFuzzFunction · 0.68