diff options
Diffstat (limited to 'src/misc/binaryheap.hpp')
-rw-r--r-- | src/misc/binaryheap.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/misc/binaryheap.hpp b/src/misc/binaryheap.hpp index 65c026ac0..944032cac 100644 --- a/src/misc/binaryheap.hpp +++ b/src/misc/binaryheap.hpp @@ -87,8 +87,9 @@ protected: /* while children are valid */ while (child <= this->items) { /* choose the smaller child */ - if (child < this->items && *this->data[child + 1] < *this->data[child]) + if (child < this->items && *this->data[child + 1] < *this->data[child]) { child++; + } /* is it smaller than our parent? */ if (!(*this->data[child] < *item)) { /* the smaller child is still bigger or same as parent => we are done */ |