From 01e7a152e353644caf26c741bc64f4ef6580752e Mon Sep 17 00:00:00 2001 From: Cholerae Hu Date: Tue, 29 Oct 2019 13:50:31 +0800 Subject: [PATCH] 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 --- src/cmd/compile/internal/gc/mpfloat.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/cmd/compile/internal/gc/mpfloat.go b/src/cmd/compile/internal/gc/mpfloat.go index d15f26784edd0a..401aef319de7cc 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)