Minor improvements to prevent unecessaries allocations

This commit is contained in:
Stefano Gabryel 2019-04-20 16:51:14 +02:00
commit 0e857e4467
2 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ import (
"github.com/evilsocket/islazy/tui"
)
var (
const (
AliveTimeInterval = time.Duration(10) * time.Second
PresentTimeInterval = time.Duration(1) * time.Minute
JustJoinedTimeInterval = time.Duration(10) * time.Second
@ -109,7 +109,7 @@ func (mod *Discovery) getRow(e *network.Endpoint, withMeta bool) [][]string {
})
sort.Strings(metas)
rows := [][]string{}
rows := make([][]string, 0, len(metas))
for i, m := range metas {
if i == 0 {
rows = append(rows, append(row, m))