diff --git a/nucleus/src/arch/aarch64/memory/phys_frame.rs b/nucleus/src/arch/aarch64/memory/phys_frame.rs index f030cc9..57bb0c3 100644 --- a/nucleus/src/arch/aarch64/memory/phys_frame.rs +++ b/nucleus/src/arch/aarch64/memory/phys_frame.rs @@ -142,7 +142,7 @@ impl Iterator for PhysFrameRange { type Item = PhysFrame; fn next(&mut self) -> Option { - if self.start < self.end { + if !self.is_empty() { let frame = self.start.clone(); self.start += 1; Some(frame) @@ -182,7 +182,7 @@ impl Iterator for PhysFrameRangeInclusive { type Item = PhysFrame; fn next(&mut self) -> Option { - if self.start <= self.end { + if !self.is_empty() { let frame = self.start.clone(); self.start += 1; Some(frame)