Skip to content

Commit

Permalink
fix key reference to the same pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
gusinacio committed Jun 5, 2023
1 parent 05e771a commit 151030f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ func createRowUniqueID(m map[string]string) string {
}
}
i := 0
keys := make([]*string, len(m))
keys := make([]string, len(m))
for k := range m {
keys[i] = &k
keys[i] = k
i++
}
sort.Slice(keys, func(i, j int) bool {
return *keys[i] < *keys[j]
return keys[i] < keys[j]
})
values := make([]string, len(keys))
for i, key := range keys {
values[i] = m[*key]
values[i] = m[key]
}
return strings.Join(values, "/")
}
Expand Down

0 comments on commit 151030f

Please sign in to comment.