Commit 00d53ca8 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Set the index of deleted elements to zero


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@492 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a4ded0ea
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment