go.tools/cmd/cover: s/ParseInt/Atoi/
So people stop asking me to do this. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12691044
This commit is contained in:
parent
2449594308
commit
28fe5aa8d3
|
|
@ -91,15 +91,11 @@ func (b blocksByStart) Less(i, j int) bool {
|
||||||
var lineRe = regexp.MustCompile(`^(.+):([0-9]+).([0-9]+),([0-9]+).([0-9]+) ([0-9]+) ([0-9]+)$`)
|
var lineRe = regexp.MustCompile(`^(.+):([0-9]+).([0-9]+),([0-9]+).([0-9]+) ([0-9]+) ([0-9]+)$`)
|
||||||
|
|
||||||
func toInt(s string) int {
|
func toInt(s string) int {
|
||||||
i64, err := strconv.ParseInt(s, 10, 64)
|
i, err := strconv.Atoi(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
const maxInt = int64(int(^uint(0) >> 1))
|
return i
|
||||||
if i64 > maxInt {
|
|
||||||
i64 = maxInt
|
|
||||||
}
|
|
||||||
return int(i64)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boundary represents the position in a source file of the beginning or end of a
|
// Boundary represents the position in a source file of the beginning or end of a
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue