Skip to content

Commit

Permalink
fix: duplicated findStaticChild process at findChildWithLabel (#2176)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeix committed May 27, 2022
1 parent b0453b9 commit 0644cd6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions router.go
Expand Up @@ -333,10 +333,8 @@ func (n *node) findStaticChild(l byte) *node {
}

func (n *node) findChildWithLabel(l byte) *node {
for _, c := range n.staticChildren {
if c.label == l {
return c
}
if c := n.findStaticChild(l); c != nil {
return c
}
if l == paramLabel {
return n.paramChild
Expand Down

0 comments on commit 0644cd6

Please sign in to comment.