Skip to content

Commit 582e0f7

Browse files
committed
Set BinaryHeap's Node.i to 0 when popped onto root
Fixes #20
1 parent 47785bd commit 582e0f7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/binary-heap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
}
9191
var min = this.list[0];
9292
this.list[0] = this.list.pop();
93+
this.list[0].i = 0;
9394
heapify(this, 0);
9495
return min;
9596
};

0 commit comments

Comments
 (0)