aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-18 03:02:17 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-18 03:02:17 +0800
commitb7585318c7015dd81516f498aa59b86ec2ee5671 (patch)
tree982d540590d6f2f374e5128ff18a841ec85f7104
parent88d020f9f2e78a1df76e93aa4d190100414c73cb (diff)
downloaddexon-0x-contracts-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.gz
dexon-0x-contracts-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.zst
dexon-0x-contracts-b7585318c7015dd81516f498aa59b86ec2ee5671.zip
Fix heap implementation
-rw-r--r--packages/0x.js/src/utils/heap.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/0x.js/src/utils/heap.ts b/packages/0x.js/src/utils/heap.ts
index aaa17e719..1135c76b9 100644
--- a/packages/0x.js/src/utils/heap.ts
+++ b/packages/0x.js/src/utils/heap.ts
@@ -82,6 +82,9 @@ export class Heap<T> {
}
}
}
+ if (swap === n) {
+ break;
+ }
this.content[n] = this.content[swap];
this.content[swap] = element;
n = swap;