]> Cypherpunks repositories - gostls13.git/commitdiff
strconv: don't call internal Atoi twice in Atoi
authorDaniel Müllner <muellner@google.com>
Mon, 19 Jan 2026 08:18:05 +0000 (09:18 +0100)
committerCarlos Amedee <carlos@golang.org>
Tue, 20 Jan 2026 18:18:00 +0000 (10:18 -0800)
Change-Id: I89a41bbc83fdf473399527a933d57794ce83f68a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737261
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
src/strconv/number.go

index 3fa625c35ffaaf8371cee8258e7eb32a03b16f2e..acaed1c96ebf1bde92242e3b2d74fb18b6dfb7dd 100644 (file)
@@ -148,7 +148,7 @@ func Atoi(s string) (int, error) {
        if err != nil {
                return x, toError("Atoi", s, 0, 0, err)
        }
-       return strconv.Atoi(s)
+       return x, nil
 }
 
 // FormatComplex converts the complex number c to a string of the