Replace unreachable expect with tidier solution (#1278)
This commit is contained in:
parent
710409c2ba
commit
6d507ef863
@ -1225,14 +1225,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while !filtered_chain_segment.is_empty() {
|
while let Some((_root, block)) = filtered_chain_segment.first() {
|
||||||
// Determine the epoch of the first block in the remaining segment.
|
// Determine the epoch of the first block in the remaining segment.
|
||||||
let start_epoch = filtered_chain_segment
|
let start_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch());
|
||||||
.first()
|
|
||||||
.map(|(_root, block)| block)
|
|
||||||
.expect("chain_segment cannot be empty")
|
|
||||||
.slot()
|
|
||||||
.epoch(T::EthSpec::slots_per_epoch());
|
|
||||||
|
|
||||||
// The `last_index` indicates the position of the last block that is in the current
|
// The `last_index` indicates the position of the last block that is in the current
|
||||||
// epoch of `start_epoch`.
|
// epoch of `start_epoch`.
|
||||||
|
Loading…
Reference in New Issue
Block a user