Skip to content

Commit

Permalink
Change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
3DRX committed Jul 16, 2024
1 parent 3683763 commit 450ec4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/route/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,10 @@ func (engine *Engine) ServeHTTP(c context.Context, ctx *app.RequestContext) {
return
}

// if ctx.Params is re-assigned by user in HandlerFunc and the capacity changed we need to realloc
paramsCnt := int(engine.maxParams)
if cap(ctx.Params) < paramsCnt {
ctx.Params = make(param.Params, 0, paramsCnt)
// if Params is re-assigned in HandlerFunc and the capacity is not enough we need to realloc
maxParams := int(engine.maxParams)
if cap(ctx.Params) < maxParams {
ctx.Params = make(param.Params, 0, maxParams)
}

// Find root of the tree for the given HTTP method
Expand Down

0 comments on commit 450ec4b

Please sign in to comment.