[sq] fix iterator checks

This commit is contained in:
Berkus Decker 2021-02-28 00:46:06 +02:00
parent bf291b917f
commit b787a2224d
1 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
type Item = PhysFrame<S>;
fn next(&mut self) -> Option<Self::Item> {
if self.start < self.end {
if !self.is_empty() {
let frame = self.start.clone();
self.start += 1;
Some(frame)
@ -182,7 +182,7 @@ impl<S: PageSize> Iterator for PhysFrameRangeInclusive<S> {
type Item = PhysFrame<S>;
fn next(&mut self) -> Option<Self::Item> {
if self.start <= self.end {
if !self.is_empty() {
let frame = self.start.clone();
self.start += 1;
Some(frame)