Improved performance
This commit is contained in:
parent
b30dad77dc
commit
6640143ace
3 changed files with 10 additions and 7 deletions
|
@ -41,10 +41,13 @@ func New() Server {
|
|||
config: defaultConfig(),
|
||||
handlers: []Handler{
|
||||
func(c Context) error {
|
||||
handler := c.(*ctx).server.router.LookupNoAlloc(c.Method(), c.Path(), c.(*ctx).addParameter)
|
||||
ctx := c.(*ctx)
|
||||
method := ctx.Method()
|
||||
path := ctx.Path()
|
||||
handler := ctx.server.router.LookupNoAlloc(method, path, ctx.addParameter)
|
||||
|
||||
if handler == nil {
|
||||
return c.Status(http.StatusNotFound).String(http.StatusText(http.StatusNotFound))
|
||||
return ctx.Status(http.StatusNotFound).String(http.StatusText(http.StatusNotFound))
|
||||
}
|
||||
|
||||
return handler(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue