From b787a2224de4413f3128ad35a99ca7149d9f4921 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sun, 28 Feb 2021 00:46:06 +0200 Subject: [PATCH] [sq] fix iterator checks --- nucleus/src/arch/aarch64/memory/phys_frame.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)