From 0e5d18bb8cf728f1fdfed94b3c9fe0d68726b13d Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Tue, 23 Jan 2018 17:23:12 -0600 Subject: [PATCH] Preallocate slice for skipped nodes --- scheduler/select.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scheduler/select.go b/scheduler/select.go index 133156048..db9a31632 100644 --- a/scheduler/select.go +++ b/scheduler/select.go @@ -21,6 +21,7 @@ func NewLimitIterator(ctx Context, source RankIterator, limit int, scoreThreshol limit: limit, maxSkip: maxSkip, scoreThreshold: scoreThreshold, + skippedNodes: make([]*RankedNode, 0, limit+maxSkip), } return iter }