[Bf-blender-cvs] [8d8ba449013] geometry-nodes-distribute-points: Revert changes to BLI_heap
Sebastian Parborg
noreply at git.blender.org
Tue Nov 24 15:00:40 CET 2020
Commit: 8d8ba44901385a74fabba2645f3268201c348f84
Author: Sebastian Parborg
Date: Tue Nov 24 15:00:24 2020 +0100
Branches: geometry-nodes-distribute-points
https://developer.blender.org/rB8d8ba44901385a74fabba2645f3268201c348f84
Revert changes to BLI_heap
===================================================================
M source/blender/blenlib/BLI_heap.h
M source/blender/blenlib/intern/BLI_heap.c
===================================================================
diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h
index b0679f66c77..4cfb7945303 100644
--- a/source/blender/blenlib/BLI_heap.h
+++ b/source/blender/blenlib/BLI_heap.h
@@ -46,7 +46,6 @@ bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1);
unsigned int BLI_heap_len(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
HeapNode *BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
float BLI_heap_top_value(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
-HeapNode *BLI_heap_idx(const Heap *heap, unsigned int idx) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
void *BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1);
void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1, 2);
void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, void *ptr)
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c
index 70a5044e070..a221820d4c4 100644
--- a/source/blender/blenlib/intern/BLI_heap.c
+++ b/source/blender/blenlib/intern/BLI_heap.c
@@ -183,8 +183,8 @@ static struct HeapNode *heap_node_alloc(Heap *heap)
static void heap_node_free(Heap *heap, HeapNode *node)
{
- // node->ptr = heap->nodes.free;
- // heap->nodes.free = node;
+ node->ptr = heap->nodes.free;
+ heap->nodes.free = node;
}
/** \} */
@@ -332,16 +332,6 @@ float BLI_heap_top_value(const Heap *heap)
return heap->tree[0]->value;
}
-/**
- * Return the heap node at idx.
- */
-HeapNode *BLI_heap_idx(const Heap *heap, unsigned int idx)
-{
- BLI_assert(idx < heap->size);
-
- return heap->tree[idx];
-}
-
/**
* Pop the top node off the heap and return its pointer.
*/
More information about the Bf-blender-cvs
mailing list