chore(stdiscosrv): reduce unnecessary allocations in merge

This commit is contained in:
Jakob Borg 2024-09-08 21:16:13 +02:00
parent 77f7778292
commit 822b6ac36b
No known key found for this signature in database

View File

@ -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 {