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

@ -112,20 +112,20 @@ func sigpanic() {
}
func atolwhex(p string) int64 {
for hasprefix(p, " ") || hasprefix(p, "\t") {
for hasPrefix(p, " ") || hasPrefix(p, "\t") {
p = p[1:]
}
neg := false
if hasprefix(p, "-") || hasprefix(p, "+") {
if hasPrefix(p, "-") || hasPrefix(p, "+") {
neg = p[0] == '-'
p = p[1:]
for hasprefix(p, " ") || hasprefix(p, "\t") {
for hasPrefix(p, " ") || hasPrefix(p, "\t") {
p = p[1:]
}
}
var n int64
switch {
case hasprefix(p, "0x"), hasprefix(p, "0X"):
case hasPrefix(p, "0x"), hasPrefix(p, "0X"):
p = p[2:]
for ; len(p) > 0; p = p[1:] {
if '0' <= p[0] && p[0] <= '9' {
@ -138,7 +138,7 @@ func atolwhex(p string) int64 {
break
}
}
case hasprefix(p, "0"):
case hasPrefix(p, "0"):
for ; len(p) > 0 && '0' <= p[0] && p[0] <= '7'; p = p[1:] {
n = n*8 + int64(p[0]-'0')
}