forked from mirror/gin
Make countParams more readable (#2052)
This commit is contained in:
parent
9aa870f108
commit
b562fed3aa
5
tree.go
5
tree.go
|
@ -65,10 +65,9 @@ func min(a, b int) int {
|
||||||
func countParams(path string) uint8 {
|
func countParams(path string) uint8 {
|
||||||
var n uint
|
var n uint
|
||||||
for i := 0; i < len(path); i++ {
|
for i := 0; i < len(path); i++ {
|
||||||
if path[i] != ':' && path[i] != '*' {
|
if path[i] == ':' || path[i] == '*' {
|
||||||
continue
|
n++
|
||||||
}
|
}
|
||||||
n++
|
|
||||||
}
|
}
|
||||||
if n >= 255 {
|
if n >= 255 {
|
||||||
return 255
|
return 255
|
||||||
|
|
Loading…
Reference in New Issue