runtime: replace calls to hasprefix with hasPrefix

The hasprefix function is redundant and can be removed since it has
the same implementation as hasPrefix modulo variable names.

Fixes #25688

Change-Id: I499cc24a2b5c38d1301718a4e66f555fd138386f
Reviewed-on: https://go-review.googlesource.com/115835
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
This commit is contained in:
Martin Möhrmann 2018-06-01 19:25:57 +02:00 committed by Brad Fitzpatrick
parent 2fad8b219f
commit b0dc54697b
7 changed files with 14 additions and 18 deletions

View file

@ -333,7 +333,7 @@ func index(s, t string) int {
return 0
}
for i := 0; i < len(s); i++ {
if s[i] == t[0] && hasprefix(s[i:], t) {
if s[i] == t[0] && hasPrefix(s[i:], t) {
return i
}
}
@ -344,8 +344,8 @@ func contains(s, t string) bool {
return index(s, t) >= 0
}
func hasprefix(s, t string) bool {
return len(s) >= len(t) && s[:len(t)] == t
func hasPrefix(s, prefix string) bool {
return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
const (