mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1535] Don't reuse pointers on loop (#1069)
* [NOD-1535] Don't reuse pointers on loop * [NOD-1535] Don't reuse pointers on loop
This commit is contained in:
parent
aeded07815
commit
b50421beee
@ -55,8 +55,9 @@ func (hs HashSet) Subtract(other HashSet) HashSet {
|
||||
diff := New()
|
||||
|
||||
for hash := range hs {
|
||||
if !other.Contains(&hash) {
|
||||
diff.Add(&hash)
|
||||
hashCopy := hash
|
||||
if !other.Contains(&hashCopy) {
|
||||
diff.Add(&hashCopy)
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +80,8 @@ func (hs HashSet) ToSlice() []*externalapi.DomainHash {
|
||||
slice := make([]*externalapi.DomainHash, 0, len(hs))
|
||||
|
||||
for hash := range hs {
|
||||
slice = append(slice, &hash)
|
||||
hashCopy := hash
|
||||
slice = append(slice, &hashCopy)
|
||||
}
|
||||
|
||||
return slice
|
||||
|
Loading…
x
Reference in New Issue
Block a user