cache: Avoid reallocs in Index

pull/6/head
kargakis 2015-08-01 17:42:43 +02:00 committed by kargakis
parent 769230e735
commit 95a27394cc
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{},
}
}
list := []interface{}{}
list := make([]interface{}, 0, returnKeySet.Len())
for absoluteKey := range returnKeySet {
list = append(list, c.items[absoluteKey])
}