Skip to content

Commit 609021d

Browse files
committed
fix: duplicated findStaticChild process at findChildWithLabel
1 parent 6df1c35 commit 609021d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

router.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ func (n *node) findStaticChild(l byte) *node {
333333
}
334334

335335
func (n *node) findChildWithLabel(l byte) *node {
336-
for _, c := range n.staticChildren {
337-
if c.label == l {
338-
return c
339-
}
336+
if c := n.findStaticChild(l); c != nil {
337+
return c
340338
}
341339
if l == paramLabel {
342340
return n.paramChild

0 commit comments

Comments
 (0)