From 1a5cd0e6d2286783b1d48cd044782490e79250c9 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Fri, 13 Dec 2019 23:38:05 +0000 Subject: [PATCH] Review comments #1. --- internal/profiling/buffer/buffer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/profiling/buffer/buffer.go b/internal/profiling/buffer/buffer.go index f1b5791882ad..45745cd09197 100644 --- a/internal/profiling/buffer/buffer.go +++ b/internal/profiling/buffer/buffer.go @@ -257,8 +257,7 @@ func (cb *CircularBuffer) Drain() []interface{} { result := make([]interface{}, 0) for i := 0; i < len(qs); i++ { - acquired := atomic.LoadUint32(&qs[i].acquired) - if acquired < qs[i].size { + if acquired := atomic.LoadUint32(&qs[i].acquired); acquired < qs[i].size { result = dereferenceAppend(result, qs[i].arr, 0, acquired) } else { result = dereferenceAppend(result, qs[i].arr, 0, qs[i].size)