File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,9 @@ func IDKey(ids IDMap) string {
134134}
135135
136136func sortIDMap (ids IDMap ) ([]wallet.BackendID , []ID ) {
137- indexes := make ( []int , len ( ids ))
137+ var indexes []int //nolint:prealloc
138138 for i := range ids {
139- indexes [ i ] = int (i )
139+ indexes = append ( indexes , int (i ) )
140140 }
141141 sort .Ints (indexes )
142142 sortedIndexes := make ([]wallet.BackendID , len (indexes ))
Original file line number Diff line number Diff line change @@ -178,9 +178,9 @@ func Key(a Address) AddrKey {
178178
179179// Keys returns the `AddrKey` corresponding to the passed `map[int]Address`.
180180func Keys (addressMap map [wallet.BackendID ]Address ) AddrKey {
181- indexes := make ( []int , len ( addressMap ))
181+ var indexes []int //nolint:prealloc
182182 for i := range addressMap {
183- indexes [ i ] = int (i )
183+ indexes = append ( indexes , int (i ) )
184184 }
185185 sort .Ints (indexes )
186186
You can’t perform that action at this time.
0 commit comments