]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: remove atoi function (minor cleanup)
authorRobert Griesemer <gri@golang.org>
Tue, 20 Oct 2015 17:52:41 +0000 (10:52 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 20 Oct 2015 17:55:39 +0000 (17:55 +0000)
Change-Id: I0ad7836c0e8d70ffdc458e125d97b01e85d8a608
Reviewed-on: https://go-review.googlesource.com/16130
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/util.go

index c989f51f8c77855b60814d67ef6d039ea28f4b46..578b30c97db62ac6cfc425df6a3c7bb0d71c6fc3 100644 (file)
@@ -7,6 +7,7 @@ package gc
 import (
        "cmd/internal/obj"
        "fmt"
+       "strconv"
        "strings"
 )
 
@@ -1124,7 +1125,8 @@ func parsetag(note *string) uint16 {
        if note == nil || !strings.HasPrefix(*note, "esc:") {
                return EscUnknown
        }
-       em := uint16(atoi((*note)[4:]))
+       n, _ := strconv.ParseInt((*note)[4:], 0, 0)
+       em := uint16(n)
        if em == 0 {
                return EscNone
        }
index 6533c9aff9acc8b9a0343b841265d9c410f29d33..7ed3b39b833f3605c0ad318b5c2839c6f2600e30 100644 (file)
@@ -4,19 +4,12 @@ import (
        "os"
        "runtime"
        "runtime/pprof"
-       "strconv"
 )
 
 func (n *Node) Line() string {
        return Ctxt.LineHist.LineString(int(n.Lineno))
 }
 
-func atoi(s string) int {
-       // NOTE: Not strconv.Atoi, accepts hex and octal prefixes.
-       n, _ := strconv.ParseInt(s, 0, 0)
-       return int(n)
-}
-
 var atExitFuncs []func()
 
 func AtExit(f func()) {