From b562fed3aa28c6e6d0299406d6b06bcb16a498cc Mon Sep 17 00:00:00 2001 From: ZYunH Date: Wed, 11 Sep 2019 18:10:39 +0800 Subject: [PATCH] Make countParams more readable (#2052) --- tree.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tree.go b/tree.go index 371d5ad1..41947570 100644 --- a/tree.go +++ b/tree.go @@ -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