aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/utils/heap.ts
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 /packages/0x.js/src/utils/heap.ts
parent88d020f9f2e78a1df76e93aa4d190100414c73cb (diff)
downloaddexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.gz
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.bz2
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.lz
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.xz
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.tar.zst
dexon-sol-tools-b7585318c7015dd81516f498aa59b86ec2ee5671.zip
Fix heap implementation
Diffstat (limited to 'packages/0x.js/src/utils/heap.ts')
-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;