mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 23:12:17 +08:00
remove varsCount
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
450ff5e153
commit
9b0fe9690a
5
gin.go
5
gin.go
@ -258,7 +258,6 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
|
|||||||
assert1(len(handlers) > 0, "there must be at least one handler")
|
assert1(len(handlers) > 0, "there must be at least one handler")
|
||||||
|
|
||||||
debugPrintRoute(method, path, handlers)
|
debugPrintRoute(method, path, handlers)
|
||||||
varsCount := uint16(0)
|
|
||||||
|
|
||||||
root := engine.trees.get(method)
|
root := engine.trees.get(method)
|
||||||
if root == nil {
|
if root == nil {
|
||||||
@ -269,8 +268,8 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
|
|||||||
root.addRoute(path, handlers)
|
root.addRoute(path, handlers)
|
||||||
|
|
||||||
// Update maxParams
|
// Update maxParams
|
||||||
if paramsCount := countParams(path); paramsCount+varsCount > engine.maxParams {
|
if paramsCount := countParams(path); paramsCount > engine.maxParams {
|
||||||
engine.maxParams = paramsCount + varsCount
|
engine.maxParams = paramsCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user