aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/utils/heap.ts
diff options
context:
space:
mode:
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;