|
|
@ -97,23 +97,22 @@ func (t *Tree) next(n *node, route string, result *Result) bool {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for i := range route {
|
|
|
|
for i := range route {
|
|
|
|
if route[i] == slash {
|
|
|
|
if route[i] != slash {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
token := route[:i]
|
|
|
|
token := route[:i]
|
|
|
|
return n.forEach(func(k string, v *node) bool {
|
|
|
|
return n.forEach(func(k string, v *node) bool {
|
|
|
|
if r := match(k, token); r.found {
|
|
|
|
r := match(k, token)
|
|
|
|
if t.next(v, route[i+1:], result) {
|
|
|
|
if !r.found || !t.next(v, route[i+1:], result) {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
if r.named {
|
|
|
|
if r.named {
|
|
|
|
addParam(result, r.key, r.value)
|
|
|
|
addParam(result, r.key, r.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return n.forEach(func(k string, v *node) bool {
|
|
|
|
return n.forEach(func(k string, v *node) bool {
|
|
|
|
if r := match(k, route); r.found && v.item != nil {
|
|
|
|
if r := match(k, route); r.found && v.item != nil {
|
|
|
|