chore: slice loop replace (#11349)

This commit is contained in:
guangwu 2023-10-25 01:02:28 +08:00 committed by GitHub
parent 14a7ae339f
commit 2d8dbf5bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View File

@ -212,13 +212,8 @@ func (cs *ChainStore) MessagesForTipset(ctx context.Context, ts *types.TipSet) (
var out []types.ChainMsg
for _, bm := range bmsgs {
for _, blsm := range bm.BlsMessages {
out = append(out, blsm)
}
for _, secm := range bm.SecpkMessages {
out = append(out, secm)
}
out = append(out, bm.BlsMessages...)
out = append(out, bm.SecpkMessages...)
}
return out, nil

View File

@ -656,9 +656,7 @@ func (cs *ChainStore) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRe
}
if b.Height > 0 {
for _, p := range b.Parents {
blocksToWalk = append(blocksToWalk, p)
}
blocksToWalk = append(blocksToWalk, b.Parents...)
} else {
// include the genesis block
cids = append(cids, b.Parents...)