(svn r13457) [NoAI] -Fix: fix the binary heap implementation to ... remain a valid binary heap tree :)
--- a/bin/ai/library/queue/binary_heap/main.nut Tue Jun 10 21:51:01 2008 +0000
+++ b/bin/ai/library/queue/binary_heap/main.nut Tue Jun 10 22:32:48 2008 +0000
@@ -63,7 +63,7 @@
local hole;
/* Find the point of insertion */
- for (hole = this._count - 1; hole > 0 && priority < this._queue[hole / 2][1]; hole /= 2)
+ for (hole = this._count - 1; hole > 0 && priority <= this._queue[hole / 2][1]; hole /= 2)
this._queue[hole] = this._queue[hole / 2];
/* Insert new pair */
this._queue[hole] = [item, priority];