diff options
| author | chenzizhan <[email protected]> | 2023-07-24 13:53:44 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-24 13:53:44 +0800 |
| commit | 2bf8cbf5ae1773b6d0a517d4488df7f36cad4df2 (patch) | |
| tree | a6e14c47294e79fdfbdea1a36be8fc49ca4261e6 /vendors | |
| parent | b1bc77774f9453e2d7daadbdba7aa0d9d755f88f (diff) | |
debug, small performance improvement
Diffstat (limited to 'vendors')
| -rw-r--r-- | vendors/minheap/heap.c | 13 | ||||
| -rw-r--r-- | vendors/minheap/heap.h | 2 |
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 */ |
