1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:54:57 -07:00

regexp/syntax: use min func

Change-Id: I679c906057577d4a795c07a2f572b969c3ee14d5
GitHub-Last-Rev: fba371d2d6
GitHub-Pull-Request: golang/go#63350
Reviewed-on: https://go-review.googlesource.com/c/go/+/532218
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
qiulaidongfeng 2023-10-03 14:22:16 +00:00 committed by Gopher Robot
parent d98f74b31e
commit 3bd30298dd

View File

@ -382,14 +382,12 @@ func minFoldRune(r rune) rune {
if r < minFold || r > maxFold {
return r
}
min := r
m := r
r0 := r
for r = unicode.SimpleFold(r); r != r0; r = unicode.SimpleFold(r) {
if min > r {
min = r
}
m = min(m, r)
}
return min
return m
}
// op pushes a regexp with the given op onto the stack