diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-18 03:02:17 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-18 03:02:17 +0800 |
commit | b7585318c7015dd81516f498aa59b86ec2ee5671 (patch) | |
tree | 982d540590d6f2f374e5128ff18a841ec85f7104 | |
parent | 88d020f9f2e78a1df76e93aa4d190100414c73cb (diff) | |
download | dexon-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.ts | 3 |
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; |