From 3fcacec4b80445844ec22f024241b0a1fcb3d7a9 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 18 Jul 2006 12:46:23 +0000 Subject: [PATCH] Set the index of deleted elements to zero git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@492 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/lib/libvarnish/binary_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/varnish-cache/lib/libvarnish/binary_heap.c b/varnish-cache/lib/libvarnish/binary_heap.c index b0bfed8a..bc0ca99c 100644 --- a/varnish-cache/lib/libvarnish/binary_heap.c +++ b/varnish-cache/lib/libvarnish/binary_heap.c @@ -176,6 +176,8 @@ binheap_delete(struct binheap *bh, unsigned idx) assert(bh->magic == BINHEAP_MAGIC); assert(bh->next > ROOT_IDX); assert(idx < bh->next); + if (bh->update != NULL) + bh->update(bh->priv, bh->array[idx], 0); if (idx == --bh->next) return; bh->array[idx] = bh->array[bh->next]; -- 2.39.5