mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 06:42:10 +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")
|
||||
|
||||
debugPrintRoute(method, path, handlers)
|
||||
varsCount := uint16(0)
|
||||
|
||||
root := engine.trees.get(method)
|
||||
if root == nil {
|
||||
@ -269,8 +268,8 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
|
||||
root.addRoute(path, handlers)
|
||||
|
||||
// Update maxParams
|
||||
if paramsCount := countParams(path); paramsCount+varsCount > engine.maxParams {
|
||||
engine.maxParams = paramsCount + varsCount
|
||||
if paramsCount := countParams(path); paramsCount > engine.maxParams {
|
||||
engine.maxParams = paramsCount
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user