preallocated slices (#934)

This commit is contained in:
Till Knuesting
2019-11-11 00:03:51 +00:00
committed by Asim Aslam
parent c696a859be
commit 5ae3e179b9
10 changed files with 16 additions and 16 deletions

View File

@@ -292,7 +292,7 @@ func (m *mdnsRegistry) GetService(service string) ([]*Service, error) {
<-done
// create list and return
var services []*Service
services := make([]*Service, 0, len(serviceMap))
for _, service := range serviceMap {
services = append(services, service)