1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Delete useless goto statements (#1208)

This commit is contained in:
Geon Kim 2018-10-15 12:42:43 +09:00 committed by Vishal Rana
parent c8fd197fa8
commit 82917fd848

View File

@ -313,7 +313,7 @@ func (r *Router) Find(method, path string, c Context) {
// Search order static > param > any // Search order static > param > any
for { for {
if search == "" { if search == "" {
goto End break
} }
pl := 0 // Prefix length pl := 0 // Prefix length
@ -348,7 +348,7 @@ func (r *Router) Find(method, path string, c Context) {
} }
if search == "" { if search == "" {
goto End break
} }
// Static node // Static node
@ -405,10 +405,9 @@ func (r *Router) Find(method, path string, c Context) {
return return
} }
pvalues[len(cn.pnames)-1] = search pvalues[len(cn.pnames)-1] = search
goto End break
} }
End:
ctx.handler = cn.findHandler(method) ctx.handler = cn.findHandler(method)
ctx.path = cn.ppath ctx.path = cn.ppath
ctx.pnames = cn.pnames ctx.pnames = cn.pnames