]> Cypherpunks repositories - gostls13.git/commitdiff
regexp/syntax: use the Regexp.Equal static method directly
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 27 Mar 2024 23:19:22 +0000 (08:19 +0900)
committerGopher Robot <gobot@golang.org>
Fri, 29 Mar 2024 16:41:51 +0000 (16:41 +0000)
A follow-up for the recent https://go.dev/cl/573978.

Change-Id: I0e75ca0b37d9ef063bbdfb88d4d2e34647e0ee50
Reviewed-on: https://go-review.googlesource.com/c/go/+/574677
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/regexp/syntax/regexp.go

index 8ad3653abba3ccc36b4e38673a7048e583de2e0d..f15d2051230464cebc2a04d43137302e37b8e986 100644 (file)
@@ -79,7 +79,7 @@ func (x *Regexp) Equal(y *Regexp) bool {
                return slices.Equal(x.Rune, y.Rune)
 
        case OpAlternate, OpConcat:
-               return slices.EqualFunc(x.Sub, y.Sub, func(a, b *Regexp) bool { return a.Equal(b) })
+               return slices.EqualFunc(x.Sub, y.Sub, (*Regexp).Equal)
 
        case OpStar, OpPlus, OpQuest:
                if x.Flags&NonGreedy != y.Flags&NonGreedy || !x.Sub[0].Equal(y.Sub[0]) {