1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:44:48 -07:00

cmd/compile/internal/types2: use ReplaceAll in *Context.instanceHash

strings.ReplaceAll is currently available.

Change-Id: I5e03ed43be123f9091a4e3b6bf05ffae8fb0d59b
GitHub-Last-Rev: 2cccdd0305
GitHub-Pull-Request: golang/go#62307
Reviewed-on: https://go-review.googlesource.com/c/go/+/523298
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
This commit is contained in:
Jes Cok 2023-08-28 05:24:44 +00:00 committed by Gopher Robot
parent 50bd17205f
commit c5569f09f2
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ func (ctxt *Context) instanceHash(orig Type, targs []Type) string {
h.typeList(targs)
}
return strings.Replace(buf.String(), " ", "#", -1) // ReplaceAll is not available in Go1.4
return strings.ReplaceAll(buf.String(), " ", "#")
}
// lookup returns an existing instantiation of orig with targs, if it exists.

View File

@ -81,7 +81,7 @@ func (ctxt *Context) instanceHash(orig Type, targs []Type) string {
h.typeList(targs)
}
return strings.Replace(buf.String(), " ", "#", -1) // ReplaceAll is not available in Go1.4
return strings.ReplaceAll(buf.String(), " ", "#")
}
// lookup returns an existing instantiation of orig with targs, if it exists.