]> Cypherpunks.ru repositories - gostls13.git/commitdiff
internal/cpu: add comments to copied functions
authorapocelipes <seve3r@outlook.com>
Wed, 25 Oct 2023 10:29:01 +0000 (10:29 +0000)
committerKeith Randall <khr@golang.org>
Tue, 31 Oct 2023 21:32:19 +0000 (21:32 +0000)
Just as same as other copied functions,
like stringsTrimSuffix in "os/executable_procfs.go"

Change-Id: I9c9fbd75b009a5ae0e869cf1fddc77c0e08d9a67
GitHub-Last-Rev: 4c18865e15ede0f53121b6845a1879cdd70d1a38
GitHub-Pull-Request: golang/go#63704
Reviewed-on: https://go-review.googlesource.com/c/go/+/537056
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/internal/cpu/cpu.go

index b6cbf2f661d952f7e6b6b479caf34ed29310bb0d..91b5b9b91f6e07766c72cd166c1db6963250028e 100644 (file)
@@ -213,6 +213,8 @@ field:
 
 // indexByte returns the index of the first instance of c in s,
 // or -1 if c is not present in s.
+// indexByte is semantically the same as [strings.IndexByte].
+// We copy this function because "internal/cpu" should not have external dependencies.
 func indexByte(s string, c byte) int {
        for i := 0; i < len(s); i++ {
                if s[i] == c {