Skip to content

Commit

Permalink
fix: VecIter using bounded RangeIter
Browse files Browse the repository at this point in the history
  • Loading branch information
julio4 committed Jan 15, 2025
1 parent 12d7113 commit 2619e0b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions corelib/src/starknet/storage/vec.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ pub impl VecIntoIterRange<
}
#[inline]
fn into_iter_full_range(self: StoragePath<Vec<T>>) -> Self::IntoIter {
VecIter { current_index: (0..VecTraitImpl::len(self)).into_iter(), vec: self }
VecIter { current_index: (0..core::num::traits::Bounded::MAX).into_iter(), vec: self }
}
}

Expand All @@ -442,7 +442,7 @@ pub impl PathableVecIntoIterRange<
#[inline]
fn into_iter_full_range(self: T) -> Self::IntoIter {
let vec = self.as_path();
VecIter { current_index: (0..vec.len()).into_iter(), vec }
VecIter { current_index: (0..core::num::traits::Bounded::MAX).into_iter(), vec }
}
}

Expand Down Expand Up @@ -473,7 +473,9 @@ pub impl MutableVecIntoIterRange<
}
#[inline]
fn into_iter_full_range(self: StoragePath<Mutable<Vec<T>>>) -> Self::IntoIter {
MutableVecIter { current_index: (0..MutVecTraitImpl::len(self)).into_iter(), vec: self }
MutableVecIter {
current_index: (0..core::num::traits::Bounded::MAX).into_iter(), vec: self,
}
}
}

Expand All @@ -493,6 +495,6 @@ pub impl PathableMutableVecIntoIterRange<
#[inline]
fn into_iter_full_range(self: T) -> Self::IntoIter {
let vec = self.as_path();
MutableVecIter { current_index: (0..vec.len()).into_iter(), vec }
MutableVecIter { current_index: (0..core::num::traits::Bounded::MAX).into_iter(), vec }
}
}

0 comments on commit 2619e0b

Please sign in to comment.