Skip to content
Snippets Groups Projects
Commit 904092b1 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Use indexing in the deduplication function

parent 254f7c36
3 merge requests!233Modify restore to call user-defined bindings callback. Add Sent requests to...,!231Revert "Update store to print changes to the partners list",!192Hotfix/improved restore
......@@ -320,10 +320,10 @@ func (b *Backup) assembleBackup() backup.Backup {
func deduplicate(list []*id.ID) []*id.ID {
entryMap := make(map[id.ID]bool)
newList := make([]*id.ID, 0)
for _, entry := range list {
if _, value := entryMap[*entry]; !value {
entryMap[*entry] = true
newList = append(newList, entry)
for i, _ := range list {
if _, value := entryMap[*list[i]]; !value {
entryMap[*list[i]] = true
newList = append(newList, list[i])
}
}
return newList
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment