runtime: make use of stringslite.{HasPrefix, HasSuffix}

Change-Id: I7461a892e1591e3bad876f0a718a99e6de2c4659
Reviewed-on: https://go-review.googlesource.com/c/go/+/585435
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Jes Cok 2024-05-15 02:37:41 +08:00 committed by Michael Knyszek
parent d11e417285
commit 2c635b68fd
11 changed files with 33 additions and 28 deletions

View file

@ -341,14 +341,6 @@ func gostringn(p *byte, l int) string {
return s
}
func hasPrefix(s, prefix string) bool {
return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
func hasSuffix(s, suffix string) bool {
return len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix
}
const (
maxUint64 = ^uint64(0)
maxInt64 = int64(maxUint64 >> 1)