Skip to content

Commit 4a8e38b

Browse files
committed
dbft: use built-in copy instead of manual copying
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
1 parent 7624837 commit 4a8e38b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

consensus/dbft/dbft.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ func New(config *params.DBFTConfig, _ ethdb.Database) (*DBFT, error) {
402402
}
403403

404404
var sorted = make([]common.Hash, len(hashes))
405-
for i := range hashes {
406-
sorted[i] = hashes[i]
407-
}
405+
copy(sorted, hashes)
408406
sort.Slice(sorted, func(i, j int) bool {
409407
return sorted[i].Cmp(sorted[j]) < 0
410408
})

0 commit comments

Comments
 (0)