From: Daniel Martí Date: Wed, 27 Mar 2024 23:19:22 +0000 (+0900) Subject: regexp/syntax: use the Regexp.Equal static method directly X-Git-Tag: go1.23rc1~738 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=27c7a3dcc3327e265cf9ecd870eecb07a4408c36;p=gostls13.git regexp/syntax: use the Regexp.Equal static method directly 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 Reviewed-by: Than McIntosh LUCI-TryBot-Result: Go LUCI Auto-Submit: Emmanuel Odeke Reviewed-by: Ian Lance Taylor --- diff --git a/src/regexp/syntax/regexp.go b/src/regexp/syntax/regexp.go index 8ad3653abb..f15d205123 100644 --- a/src/regexp/syntax/regexp.go +++ b/src/regexp/syntax/regexp.go @@ -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]) {