From c5569f09f22a6c002f1f6dc694272c3a84d4b16c Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Mon, 28 Aug 2023 05:24:44 +0000 Subject: [PATCH] cmd/compile/internal/types2: use ReplaceAll in *Context.instanceHash 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 Run-TryBot: Robert Griesemer TryBot-Result: Gopher Robot Auto-Submit: Robert Griesemer Reviewed-by: Joedian Reid --- src/cmd/compile/internal/types2/context.go | 2 +- src/go/types/context.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/types2/context.go b/src/cmd/compile/internal/types2/context.go index ae39c7b830..772312463e 100644 --- a/src/cmd/compile/internal/types2/context.go +++ b/src/cmd/compile/internal/types2/context.go @@ -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. diff --git a/src/go/types/context.go b/src/go/types/context.go index 56368e1060..ce9bbf305e 100644 --- a/src/go/types/context.go +++ b/src/go/types/context.go @@ -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. -- 2.50.0