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:
parent
d98f74b31e
commit
3bd30298dd
@ -382,14 +382,12 @@ func minFoldRune(r rune) rune {
|
|||||||
if r < minFold || r > maxFold {
|
if r < minFold || r > maxFold {
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
min := r
|
m := r
|
||||||
r0 := r
|
r0 := r
|
||||||
for r = unicode.SimpleFold(r); r != r0; r = unicode.SimpleFold(r) {
|
for r = unicode.SimpleFold(r); r != r0; r = unicode.SimpleFold(r) {
|
||||||
if min > r {
|
m = min(m, r)
|
||||||
min = r
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return min
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
// op pushes a regexp with the given op onto the stack
|
// op pushes a regexp with the given op onto the stack
|
||||||
|
Loading…
Reference in New Issue
Block a user