From 30965f6f1f8f97ecc0ead16b2b5fbf7b2b1e0ad3 Mon Sep 17 00:00:00 2001 From: jmacd Date: Sun, 24 Nov 2019 21:29:48 -0800 Subject: [PATCH] Pre-allocate main buffers --- varopt.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/varopt.go b/varopt.go index 99fd01c..f573850 100644 --- a/varopt.go +++ b/varopt.go @@ -51,6 +51,8 @@ func New(capacity int, rnd *rand.Rand) *Varopt { return &Varopt{ capacity: capacity, rnd: rnd, + L: make(internal.SampleHeap, 0, capacity), + T: make(internal.SampleHeap, 0, capacity), } }