From 609021dc5a9d27534787d1bd14a17f5701d8397c Mon Sep 17 00:00:00 2001 From: lkeix Date: Thu, 12 May 2022 22:55:39 +0900 Subject: [PATCH] fix: duplicated findStaticChild process at findChildWithLabel --- router.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/router.go b/router.go index a1de2d6e3..b5e50d94f 100644 --- a/router.go +++ b/router.go @@ -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