preallocating slices (#904)
* preallocated some slices when size is known * gofmt * gofmt
This commit is contained in:
committed by
Asim Aslam
parent
2f3c251b00
commit
24b8d2a315
@@ -1186,7 +1186,7 @@ func (t *tun) Links() []Link {
|
||||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
|
||||
var links []Link
|
||||
links := make([]Link, 0, len(t.links))
|
||||
|
||||
for _, link := range t.links {
|
||||
links = append(links, link)
|
||||
|
||||
Reference in New Issue
Block a user