summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2024-09-08 21:16:13 +0200
committerJakob Borg <jakob@kastelo.net>2024-09-13 08:48:03 +0200
commit822b6ac36bf25da728eac09aa42f1aeb1a029c40 (patch)
tree7c176811c8e44ee4eb40fa10da368341c58a9921
parent77f7778292a9dcce5b70b6e179cd10c006a05708 (diff)
chore(stdiscosrv): reduce unnecessary allocations in merge
-rw-r--r--cmd/stdiscosrv/database.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/stdiscosrv/database.go b/cmd/stdiscosrv/database.go
index 29686e5840..a6cbd424f3 100644
--- a/cmd/stdiscosrv/database.go
+++ b/cmd/stdiscosrv/database.go
@@ -350,7 +350,7 @@ func merge(a, b DatabaseRecord) DatabaseRecord {
}
res := DatabaseRecord{
- Addresses: make([]DatabaseAddress, 0, len(a.Addresses)+len(b.Addresses)),
+ Addresses: make([]DatabaseAddress, 0, max(len(a.Addresses), len(b.Addresses))),
Seen: a.Seen,
}
if b.Seen > a.Seen {