Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0354434

Browse files
winterfxtrend-winter-wang
andauthoredMar 14, 2025
Refactor: remove unnecessary parameters (microsoft#558)
Co-authored-by: winter_wang <[email protected]>
1 parent 7d122f1 commit 0354434

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎internal/astnav/tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func getTokenAtPosition(
8282
}
8383

8484
visitNodes := func(nodes []*ast.Node) {
85-
index, match := core.BinarySearchUniqueFunc(nodes, position, func(middle int, node *ast.Node) int {
85+
index, match := core.BinarySearchUniqueFunc(nodes, func(middle int, node *ast.Node) int {
8686
cmp := testNode(node)
8787
if cmp < 0 {
8888
left = node.End()

‎internal/core/binarysearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package core
55
// in the slice could match the target. Also, unlike [slices.BinarySearchFunc],
66
// the comparison function is passed the current index of the element being
77
// compared, instead of the target element.
8-
func BinarySearchUniqueFunc[S ~[]E, E, T any](x S, target T, cmp func(int, E) int) (int, bool) {
8+
func BinarySearchUniqueFunc[S ~[]E, E any](x S, cmp func(int, E) int) (int, bool) {
99
n := len(x)
1010
low, high := 0, n-1
1111
for low <= high {

0 commit comments

Comments
 (0)
Please sign in to comment.