mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
Minor improvements to prevent unecessaries allocations
This commit is contained in:
parent
8f761dd76c
commit
0e857e4467
2 changed files with 4 additions and 4 deletions
|
@ -8,8 +8,8 @@ import (
|
|||
)
|
||||
|
||||
func UniqueInts(a []int, sorted bool) []int {
|
||||
tmp := make(map[int]bool)
|
||||
uniq := make([]int, 0)
|
||||
tmp := make(map[int]bool, len(a))
|
||||
uniq := make([]int, 0, len(a))
|
||||
|
||||
for _, n := range a {
|
||||
tmp[n] = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue