Commit 01e7a152 authored by Cholerae Hu's avatar Cholerae Hu Committed by Robert Griesemer

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/+/203997Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 9e094ea0
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment