X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fprio_heap%2Fprio_heap.c;h=29af3033812f98ba770ee28b855959b8dca82bfd;hb=6074d5430effe9efb2a1c8486cabcfbcb8eafb63;hp=c987d5de18cd10d690aa2c7152c95bc33b621dfa;hpb=a29e892a9ba3f8bf865787fde21bfd12bf8bdf26;p=lttng-modules.git diff --git a/lib/prio_heap/prio_heap.c b/lib/prio_heap/prio_heap.c index c987d5de..29af3033 100644 --- a/lib/prio_heap/prio_heap.c +++ b/lib/prio_heap/prio_heap.c @@ -158,8 +158,11 @@ int heap_insert(struct ptr_heap *heap, void *p) ptrs[pos] = ptrs[parent(pos)]; ptrs[parent(pos)] = tmp; pos = parent(pos); - /* rebalance */ - heapify(heap, pos); + /* + * No need to rebalance: if we are larger than + * our parent, we are necessarily larger than + * its other child. + */ } else { break; }