Merge fb022f54c074086fd6085cacd9731260089b8f3a into 26c3a628655cad2388380cb8102d6ce7d4875f3b

This commit is contained in:
白茶清欢 2025-12-25 20:05:58 +08:00 committed by GitHub
commit 11d0430006
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,10 +58,12 @@ func (trees methodTrees) get(method string) *node {
return nil
}
// calculate the length of the longest common prefix of two strings
func longestCommonPrefix(a, b string) int {
i := 0
max_ := min(len(a), len(b))
for i < max_ && a[i] == b[i] {
// commonPrefixMaxLen is the min value of a and b's length.
commonPrefixMaxLen := min(len(a), len(b))
for i < commonPrefixMaxLen && a[i] == b[i] {
i++
}
return i