From 7337a80eee3e05b2b77d5e1d1b65f80191c11285 Mon Sep 17 00:00:00 2001 From: winter_wang Date: Thu, 13 Mar 2025 11:15:56 +0800 Subject: [PATCH] chore: remove unnecessary parameters --- internal/astnav/tokens.go | 2 +- internal/core/binarysearch.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/astnav/tokens.go b/internal/astnav/tokens.go index feac94654d..0c09257277 100644 --- a/internal/astnav/tokens.go +++ b/internal/astnav/tokens.go @@ -82,7 +82,7 @@ func getTokenAtPosition( } visitNodes := func(nodes []*ast.Node) { - index, match := core.BinarySearchUniqueFunc(nodes, position, func(middle int, node *ast.Node) int { + index, match := core.BinarySearchUniqueFunc(nodes, func(middle int, node *ast.Node) int { cmp := testNode(node) if cmp < 0 { left = node.End() diff --git a/internal/core/binarysearch.go b/internal/core/binarysearch.go index 15871dcc47..43605d228e 100644 --- a/internal/core/binarysearch.go +++ b/internal/core/binarysearch.go @@ -5,7 +5,7 @@ package core // in the slice could match the target. Also, unlike [slices.BinarySearchFunc], // the comparison function is passed the current index of the element being // compared, instead of the target element. -func BinarySearchUniqueFunc[S ~[]E, E, T any](x S, target T, cmp func(int, E) int) (int, bool) { +func BinarySearchUniqueFunc[S ~[]E, E any](x S, cmp func(int, E) int) (int, bool) { n := len(x) low, high := 0, n-1 for low <= high {