mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-15 20:17:09 +08:00
Merge fb022f54c074086fd6085cacd9731260089b8f3a into 52ecf029bd2e9b4d2652f96dd2b753f8bc6b6e95
This commit is contained in:
commit
90cd01fb6d
6
tree.go
6
tree.go
@ -59,10 +59,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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user