Fixes performance regression

This commit is contained in:
Manu Mtz-Almeida
2015-06-04 01:54:36 +02:00
parent 21979d6a99
commit 0b043d0886
2 changed files with 22 additions and 1 deletions

3
gin.go
View File

@ -158,7 +158,7 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
panic("there must be at least one handler")
}
root := engine.trees.get("method")
root := engine.trees.get(method)
if root == nil {
root = new(node)
engine.trees = append(engine.trees, methodTree{
@ -247,6 +247,7 @@ func (engine *Engine) handleHTTPRequest(context *Context) {
return
}
}
break
}
}