From 3bd30298dd3b59f9c760f7befd6cf21bf479b766 Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Tue, 3 Oct 2023 14:22:16 +0000 Subject: [PATCH] regexp/syntax: use min func Change-Id: I679c906057577d4a795c07a2f572b969c3ee14d5 GitHub-Last-Rev: fba371d2d6bfc7fbf3a93a53bb22039acf65d7cf GitHub-Pull-Request: golang/go#63350 Reviewed-on: https://go-review.googlesource.com/c/go/+/532218 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/regexp/syntax/parse.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/regexp/syntax/parse.go b/src/regexp/syntax/parse.go index 6b360b8700..6a11b53fb1 100644 --- a/src/regexp/syntax/parse.go +++ b/src/regexp/syntax/parse.go @@ -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