mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
d11e417285
commit
2c635b68fd
11 changed files with 33 additions and 28 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue