console: preallocate slice capacities

This commit is contained in:
qcrao 2024-04-24 13:06:21 +08:00
parent 94579932b1
commit 9404205354

View file

@ -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")