From 488232e296be57ac4155ee433547e5df6f57c057 Mon Sep 17 00:00:00 2001 From: huangzw Date: Fri, 29 Mar 2024 14:51:19 +0800 Subject: [PATCH] Optimize the ShouldBindUri method of the Context struct --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index afc3c353e1..391adafed0 100644 --- a/context.go +++ b/context.go @@ -739,7 +739,7 @@ func (c *Context) ShouldBindHeader(obj any) error { // ShouldBindUri binds the passed struct pointer using the specified binding engine. func (c *Context) ShouldBindUri(obj any) error { - m := make(map[string][]string) + m := make(map[string][]string, len(c.Params)) for _, v := range c.Params { m[v.Key] = []string{v.Value} }