Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-12-09 02:13:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-12-09 02:13:35 +0300
commit55812e3acd625aa93162cd9e0894efd43a1dd615 (patch)
treec41c77fac97adce2059e213f74f58e0c957de0f8 /source/blender/blenlib/intern/BLI_heap.c
parent03760fed0d433568b1dc6e46fb7b48c59a3300b5 (diff)
Cleanup: simplify heap popmin
Diffstat (limited to 'source/blender/blenlib/intern/BLI_heap.c')
-rw-r--r--source/blender/blenlib/intern/BLI_heap.c9
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);
}