We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e5e4a8 commit 7f8a32cCopy full SHA for 7f8a32c
Sources/HeapModule/Heap.swift
@@ -363,7 +363,7 @@ extension Heap {
363
364
guard newCount > origCount, newCount > 1 else {
365
// If we didn't append, or the result is too small to violate heapness,
366
- // then we have nothing else to dp.
+ // then we have nothing else to do.
367
return
368
}
369
@@ -381,7 +381,7 @@ extension Heap {
381
//
382
// FIXME: Write a benchmark to verify this heuristic.
383
let heuristicLimit = 2 * newCount / newCount._binaryLogarithm()
384
- let useFloyd = (newCount - origCount) < heuristicLimit
+ let useFloyd = (newCount - origCount) > heuristicLimit
385
_update { handle in
386
if useFloyd {
387
handle.heapify()
0 commit comments