Skip to content

Commit

Permalink
cmd/compile: resolve TODO of Mpflt.SetString
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
choleraehyq authored and griesemer committed Oct 30, 2019
1 parent 9e094ea commit 01e7a15
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/cmd/compile/internal/gc/mpfloat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01e7a15

Please sign in to comment.