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 e5600f0 commit 584aad5Copy full SHA for 584aad5
src/go/doc/comment/parse.go
@@ -5,7 +5,7 @@
5
package comment
6
7
import (
8
- "sort"
+ "slices"
9
"strings"
10
"unicode"
11
"unicode/utf8"
@@ -260,9 +260,8 @@ func (d *parseDoc) lookupPkg(pkg string) (importPath string, ok bool) {
260
}
261
262
func isStdPkg(path string) bool {
263
- // TODO: Use slices.BinarySearch when possible.
264
- i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path })
265
- return i < len(stdPkgs) && stdPkgs[i] == path
+ _, ok := slices.BinarySearch(stdPkgs, path)
+ return ok
266
267
268
// DefaultLookupPackage is the default package lookup
0 commit comments