Skip to content

Commit 228deaa

Browse files
committed
Change useFloyd heuristic to match comment
Comment says exceed, but this checks if it is less than the limit.
1 parent 8e5e4a8 commit 228deaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/HeapModule/Heap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ extension Heap {
381381
//
382382
// FIXME: Write a benchmark to verify this heuristic.
383383
let heuristicLimit = 2 * newCount / newCount._binaryLogarithm()
384-
let useFloyd = (newCount - origCount) < heuristicLimit
384+
let useFloyd = (newCount - origCount) > heuristicLimit
385385
_update { handle in
386386
if useFloyd {
387387
handle.heapify()

0 commit comments

Comments
 (0)