From: Cholerae Hu Date: Tue, 29 Oct 2019 05:50:31 +0000 (+0800) Subject: cmd/compile: resolve TODO of Mpflt.SetString X-Git-Tag: go1.14beta1~500 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=01e7a152e353644caf26c741bc64f4ef6580752e;p=gostls13.git cmd/compile: resolve TODO of Mpflt.SetString Number literal strings returned by the lexer (internal/syntax package) and other arguments to SetString never contain leading whitespace. There's no need (anymore) to trim the argument. Change-Id: Ib060d109f46f79a364a5c8aa33c4f625fe849264 Reviewed-on: https://go-review.googlesource.com/c/go/+/203997 Reviewed-by: Robert Griesemer --- diff --git a/src/cmd/compile/internal/gc/mpfloat.go b/src/cmd/compile/internal/gc/mpfloat.go index d15f26784e..401aef319d 100644 --- a/src/cmd/compile/internal/gc/mpfloat.go +++ b/src/cmd/compile/internal/gc/mpfloat.go @@ -179,11 +179,6 @@ func (a *Mpflt) Neg() { } func (a *Mpflt) SetString(as string) { - // TODO(gri) why is this needed? - for len(as) > 0 && (as[0] == ' ' || as[0] == '\t') { - as = as[1:] - } - f, _, err := a.Val.Parse(as, 0) if err != nil { yyerror("malformed constant: %s (%v)", as, err)