diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/BLI_heap.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 1e616d1d495..05bd1074bf0 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -205,13 +205,8 @@ void *BLI_heap_popmin(Heap *heap) heap->tree[0]->ptr = heap->freenodes; heap->freenodes = heap->tree[0]; - if (UNLIKELY(heap->size == 1)) { - heap->size--; - } - else { - heap_swap(heap, 0, heap->size - 1); - heap->size--; - + if (--heap->size) { + heap_swap(heap, 0, heap->size); heap_down(heap, 0); } |