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

View File

@ -65,10 +65,9 @@ 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++
}
n++
}
if n >= 255 {
return 255