From: apocelipes Date: Wed, 25 Oct 2023 10:29:01 +0000 (+0000) Subject: internal/cpu: add comments to copied functions X-Git-Tag: go1.22rc1~469 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e73e25b624c37a936bb42f50a11f56297a4cd637;p=gostls13.git internal/cpu: add comments to copied functions 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 Reviewed-by: Martin Möhrmann TryBot-Result: Gopher Robot Run-TryBot: Martin Möhrmann Reviewed-by: Keith Randall --- diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go index b6cbf2f661..91b5b9b91f 100644 --- a/src/internal/cpu/cpu.go +++ b/src/internal/cpu/cpu.go @@ -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 {