mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:30:56 +00:00
reduce loop
This commit is contained in:
parent
a4f674e7f4
commit
5e249772d5
4
tree.go
4
tree.go
@ -334,7 +334,7 @@ func (t *Tree) match(pattern string, wildcardValues []string, ctx *context.Conte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if runObject == nil {
|
if runObject == nil && len(t.fixrouters) > 0 {
|
||||||
// Filter the .json .xml .html extension
|
// Filter the .json .xml .html extension
|
||||||
for _, str := range allowSuffixExt {
|
for _, str := range allowSuffixExt {
|
||||||
if strings.HasSuffix(seg, str) {
|
if strings.HasSuffix(seg, str) {
|
||||||
@ -353,7 +353,7 @@ func (t *Tree) match(pattern string, wildcardValues []string, ctx *context.Conte
|
|||||||
runObject = t.wildcard.match(pattern, append(wildcardValues, seg), ctx)
|
runObject = t.wildcard.match(pattern, append(wildcardValues, seg), ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if runObject == nil {
|
if runObject == nil && len(t.leaves) > 0 {
|
||||||
wildcardValues = append(wildcardValues, seg)
|
wildcardValues = append(wildcardValues, seg)
|
||||||
start, i := 0, 0
|
start, i := 0, 0
|
||||||
for ; i < len(pattern); i++ {
|
for ; i < len(pattern); i++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user