]> Cypherpunks repositories - gostls13.git/commit
strconv: use switch for '+'/'-' prefix handling
authorzhi.wang <zhi.wang@kunlun-inc.com>
Sun, 6 Apr 2025 13:08:57 +0000 (13:08 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 7 Apr 2025 20:36:46 +0000 (13:36 -0700)
commit8054d2da5bdbaf154b258d8d2fd24025a809b0de
treee8a4a49bfe036af6ce4c17c778e61b0adf43efad
parentb2819d13dbe19343426e688da4ddfeb57c8589fc
strconv: use switch for '+'/'-' prefix handling

Follow the approach used in strconv's readFloat, decimal.set, and Atoi,
where leading '+' and '-' are handled using a switch for clarity and
consistency.

Change-Id: I41eff34ce90b5ac43fcdbc0bb88910d6d5fb4d39
GitHub-Last-Rev: 0c9d2efb5a828515fa00afdba8c436aa31fb0e53
GitHub-Pull-Request: golang/go#73185
Reviewed-on: https://go-review.googlesource.com/c/go/+/663257
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/strconv/atof.go
src/strconv/atoi.go