[sq] fix iterator checks
This commit is contained in:
parent
bf291b917f
commit
b787a2224d
|
@ -142,7 +142,7 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
|
||||||
type Item = PhysFrame<S>;
|
type Item = PhysFrame<S>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
if self.start < self.end {
|
if !self.is_empty() {
|
||||||
let frame = self.start.clone();
|
let frame = self.start.clone();
|
||||||
self.start += 1;
|
self.start += 1;
|
||||||
Some(frame)
|
Some(frame)
|
||||||
|
@ -182,7 +182,7 @@ impl<S: PageSize> Iterator for PhysFrameRangeInclusive<S> {
|
||||||
type Item = PhysFrame<S>;
|
type Item = PhysFrame<S>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
if self.start <= self.end {
|
if !self.is_empty() {
|
||||||
let frame = self.start.clone();
|
let frame = self.start.clone();
|
||||||
self.start += 1;
|
self.start += 1;
|
||||||
Some(frame)
|
Some(frame)
|
||||||
|
|
Loading…
Reference in New Issue