Merge pull request #12139 from kargakis/avoid-reallocs-in-index

cache: Avoid reallocs in Index
This commit is contained in:
Dawn Chen 2015-08-06 13:00:02 -07:00
commit c1c03bb4ca

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])
}