Plugins: Optimize creation of Golang errors and slices (#69448)
* tidy up * fix tests
This commit is contained in:
@@ -33,7 +33,7 @@ func (i *InMemory) Plugins(_ context.Context) []*plugins.Plugin {
|
||||
i.mu.RLock()
|
||||
defer i.mu.RUnlock()
|
||||
|
||||
res := make([]*plugins.Plugin, 0)
|
||||
res := make([]*plugins.Plugin, 0, len(i.store))
|
||||
for _, p := range i.store {
|
||||
res = append(res, p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user