Skip to content

Commit

Permalink
Remove dead code in 'top' foreach func
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnsmithdev committed Apr 26, 2022
1 parent 4099147 commit ca562cb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ func top[K Cmpable[K], V any, R any](t *Tree[K, V], n int, reversed bool, f func
}
result := make([]R, 0, max)
t.forEachNode(func(node *Tree[K, V]) bool {
prev, next := node.left, node.right
if reversed {
prev, next = next, prev
}
result = append(result, f(node))
return len(result) < n
}, reversed)
Expand Down

0 comments on commit ca562cb

Please sign in to comment.