Make countParams more readable (#2052)

This commit is contained in:
ZYunH 2019-09-11 18:10:39 +08:00 committed by thinkerou
parent 9aa870f108
commit b562fed3aa
1 changed files with 2 additions and 3 deletions

View File

@ -65,11 +65,10 @@ func min(a, b int) int {
func countParams(path string) uint8 {
var n uint
for i := 0; i < len(path); i++ {
if path[i] != ':' && path[i] != '*' {
continue
}
if path[i] == ':' || path[i] == '*' {
n++
}
}
if n >= 255 {
return 255
}