From 28fe5aa8d355beddcc03086357bcdcec2a33782d Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 9 Aug 2013 13:48:46 +1000 Subject: [PATCH] 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 --- cmd/cover/profile.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/cover/profile.go b/cmd/cover/profile.go index caa9712f..17cc2ab2 100644 --- a/cmd/cover/profile.go +++ b/cmd/cover/profile.go @@ -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]+)$`) func toInt(s string) int { - i64, err := strconv.ParseInt(s, 10, 64) + i, err := strconv.Atoi(s) if err != nil { panic(err) } - const maxInt = int64(int(^uint(0) >> 1)) - if i64 > maxInt { - i64 = maxInt - } - return int(i64) + return i } // Boundary represents the position in a source file of the beginning or end of a