mirror of
https://github.com/golang/go
synced 2024-11-18 15:24:41 -07:00
go/doc/comment: update TODO for isStdPkg
Even better is slices.BinarySearch, leave a TODO to update to that when possible.
Change-Id: Ie1ec75c34c0329c536725b45e520693790f0520e
GitHub-Last-Rev: 6cd811b186
GitHub-Pull-Request: golang/go#62585
Reviewed-on: https://go-review.googlesource.com/c/go/+/527341
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
4ee1d542ed
commit
0460c61e5f
@ -260,8 +260,7 @@ func (d *parseDoc) lookupPkg(pkg string) (importPath string, ok bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isStdPkg(path string) bool {
|
func isStdPkg(path string) bool {
|
||||||
// TODO(rsc): Use sort.Find once we don't have to worry about
|
// TODO: Use slices.BinarySearch when possible.
|
||||||
// copying this code into older Go environments.
|
|
||||||
i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path })
|
i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path })
|
||||||
return i < len(stdPkgs) && stdPkgs[i] == path
|
return i < len(stdPkgs) && stdPkgs[i] == path
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user