mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Use checked arithmetic in types and state proc (#1009)
This commit is contained in:
@@ -164,8 +164,8 @@ impl TreeHashCache {
|
||||
fn lift_dirty(dirty_indices: &[usize]) -> SmallVec8<usize> {
|
||||
let mut new_dirty = SmallVec8::with_capacity(dirty_indices.len());
|
||||
|
||||
for i in 0..dirty_indices.len() {
|
||||
new_dirty.push(dirty_indices[i] / 2)
|
||||
for index in dirty_indices {
|
||||
new_dirty.push(index / 2)
|
||||
}
|
||||
|
||||
new_dirty.dedup();
|
||||
|
||||
@@ -89,6 +89,7 @@ impl<T: Encode + Decode> CacheArena<T> {
|
||||
/// To reiterate, the given `range` should be relative to the given `alloc_id`, not
|
||||
/// `self.backing`. E.g., if the allocation has an offset of `20` and the range is `0..1`, then
|
||||
/// the splice will translate to `self.backing[20..21]`.
|
||||
#[allow(clippy::comparison_chain)]
|
||||
fn splice_forgetful<I: IntoIterator<Item = T>>(
|
||||
&mut self,
|
||||
alloc_id: usize,
|
||||
|
||||
Reference in New Issue
Block a user