]> Cypherpunks repositories - gostls13.git/commitdiff
go/doc/comment: update TODO for isStdPkg
authorJes Cok <xigua67damn@gmail.com>
Tue, 12 Sep 2023 22:43:28 +0000 (22:43 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 13 Sep 2023 00:59:13 +0000 (00:59 +0000)
Even better is slices.BinarySearch, leave a TODO to update to that when possible.

Change-Id: Ie1ec75c34c0329c536725b45e520693790f0520e
GitHub-Last-Rev: 6cd811b186c95752794cead3ae747f54c2d0d0c5
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>

src/go/doc/comment/parse.go

index 62a0f8f2bb8e92aeb97d38f0afdb7821154bf3a3..7b60e7ad5bb62d22ebecf483ed341ce1ac66f5f4 100644 (file)
@@ -260,8 +260,7 @@ func (d *parseDoc) lookupPkg(pkg string) (importPath string, ok bool) {
 }
 
 func isStdPkg(path string) bool {
-       // TODO(rsc): Use sort.Find once we don't have to worry about
-       // copying this code into older Go environments.
+       // TODO: Use slices.BinarySearch when possible.
        i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path })
        return i < len(stdPkgs) && stdPkgs[i] == path
 }