diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-19 13:40:05 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-19 13:40:05 -0400 |
| commit | 78bcce28728b70c3abb08a391c1f9651d688c70f (patch) | |
| tree | dc40a2c4bb2ae363249fec8ad1bfa0ac3bc64a76 | |
| parent | b25e8e86d4da42aac7e7054bcee4ca99d198e4df (diff) | |
Heap cleanup
| -rw-r--r-- | builtins/array.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtins/array.c b/builtins/array.c index 22abf976..308b4946 100644 --- a/builtins/array.c +++ b/builtins/array.c @@ -467,13 +467,10 @@ static void siftdown(array_t *heap, int64_t startpos, int64_t pos, closure_t com if (cmp >= 0) break; - memcpy(newitem, heap->data + heap->stride*pos, item_size); - // swap pos/parentpos: memcpy(heap->data + heap->stride*pos, heap->data + heap->stride*parentpos, item_size); - memcpy(heap->data + heap->stride*parentpos, newitem, item_size); - pos = parentpos; } + memcpy(heap->data + heap->stride*pos, newitem, item_size); } static void siftup(array_t *heap, int64_t pos, closure_t comparison, const TypeInfo *type) |
