From 9404205354327631083790102faef7102bfe5d4c Mon Sep 17 00:00:00 2001 From: qcrao Date: Wed, 24 Apr 2024 13:06:21 +0800 Subject: [PATCH] console: preallocate slice capacities --- console/bridge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/bridge.go b/console/bridge.go index 37578041ca..5e4c2e7741 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -406,7 +406,7 @@ func (b *bridge) Send(call jsre.Call) (goja.Value, error) { } // Execute the requests. - var resps []*goja.Object + resps := make([]*goja.Object, 0, len(reqs)) for _, req := range reqs { resp := call.VM.NewObject() resp.Set("jsonrpc", "2.0")