Avoid reallocs in removeDuplicateAddresses
This commit is contained in:
parent
a0f20007c5
commit
76d258e2a1
1 changed files with 1 additions and 1 deletions
|
@ -232,7 +232,7 @@ func validDbType(dbType string) bool {
|
||||||
// removeDuplicateAddresses returns a new slice with all duplicate entries in
|
// removeDuplicateAddresses returns a new slice with all duplicate entries in
|
||||||
// addrs removed.
|
// addrs removed.
|
||||||
func removeDuplicateAddresses(addrs []string) []string {
|
func removeDuplicateAddresses(addrs []string) []string {
|
||||||
var result []string
|
result := make([]string, 0, len(addrs))
|
||||||
seen := map[string]bool{}
|
seen := map[string]bool{}
|
||||||
for _, val := range addrs {
|
for _, val := range addrs {
|
||||||
if _, ok := seen[val]; !ok {
|
if _, ok := seen[val]; !ok {
|
||||||
|
|
Loading…
Add table
Reference in a new issue