-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
there is a leak, iter need defer iter.Close().
Lines 100 to 101 in 0c9c329
| iter := dbm.IteratePrefix(store.db, []byte(prefixKey)) | |
| for ; iter.Valid(); iter.Next() { |
by the way,
Lines 82 to 85 in 0c9c329
| l2 := make([]types.Evidence, len(l)) | |
| for i := range l { | |
| l2[i] = l[len(l)-1-i] | |
| } |
should replace with reversing trick to eliminate temp slice.
for i := len(a)/2-1; i >= 0; i-- {
opp := len(a)-1-i
a[i], a[opp] = a[opp], a[i]
}
I'll make a PR for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels