]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types2: use ReplaceAll in *Context.instanceHash
authorJes Cok <xigua67damn@gmail.com>
Mon, 28 Aug 2023 05:24:44 +0000 (05:24 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 28 Aug 2023 17:29:21 +0000 (17:29 +0000)
strings.ReplaceAll is currently available.

Change-Id: I5e03ed43be123f9091a4e3b6bf05ffae8fb0d59b
GitHub-Last-Rev: 2cccdd0305fc709c8acfbb00eab744b28ca0c8fc
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>
src/cmd/compile/internal/types2/context.go
src/go/types/context.go

index ae39c7b83097a9339c8e6cc120ca26e2eca5c843..772312463e5fbae6007b6fb70a1791998760198b 100644 (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.
index 56368e1060853315ba6692bdd7eceff6d6e57f48..ce9bbf305e45aa3cc8b9199eb0f9468c7f6d937b 100644 (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.