Improved performance
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user