summaryrefslogtreecommitdiff
path: root/vendors
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2023-07-24 13:53:44 +0800
committerchenzizhan <[email protected]>2023-07-24 13:53:44 +0800
commit2bf8cbf5ae1773b6d0a517d4488df7f36cad4df2 (patch)
treea6e14c47294e79fdfbdea1a36be8fc49ca4261e6 /vendors
parentb1bc77774f9453e2d7daadbdba7aa0d9d755f88f (diff)
debug, small performance improvement
Diffstat (limited to 'vendors')
-rw-r--r--vendors/minheap/heap.c13
-rw-r--r--vendors/minheap/heap.h2
2 files changed, 0 insertions, 15 deletions
diff --git a/vendors/minheap/heap.c b/vendors/minheap/heap.c
index dd5dfc6..ba72b70 100644
--- a/vendors/minheap/heap.c
+++ b/vendors/minheap/heap.c
@@ -125,16 +125,3 @@ static void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, void* node)
s->nodes[hole_index] = node;
s->set(hole_index, s->nodes[hole_index]);
}
-
-typedef void *(*minheap_copy_node)(const void *node);
-
-void min_heap_copy(min_heap_t *dst, const min_heap_t *src, minheap_copy_node copy_func)
-{
- for (int i = 0; i < src->max_size; i++) {
- if (src->nodes[i] == NULL) {
- dst->nodes[i] = NULL;
- continue;
- }
- dst->nodes[i] = copy_func(src->nodes[i]);
- }
-} \ No newline at end of file
diff --git a/vendors/minheap/heap.h b/vendors/minheap/heap.h
index 055e217..ede65bf 100644
--- a/vendors/minheap/heap.h
+++ b/vendors/minheap/heap.h
@@ -6,7 +6,6 @@
typedef bool (*minheap_cmp)(void *a, void *b);
typedef int (*minheap_getindex)(void *a);
typedef void (*minheap_setindex)(int index, void *a);
-typedef void *(*minheap_copy_node)(const void *node);
typedef struct minheap
{
@@ -34,5 +33,4 @@ void *pop_heap(struct minheap *heap);
int adjust_heap_node(struct minheap *heap, void *node);
int erase_heap_node(struct minheap* heap, void *node);
-void min_heap_copy(min_heap_t *dst, const min_heap_t *src, minheap_copy_node copy_func);
#endif /* MINHEAP_H */