Skip to content

Commit

Permalink
ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tompro committed Feb 24, 2024
1 parent b0e45d3 commit 31009e5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/kernel/src/signal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ impl Iterator for SignalIter {
type Item = Signal;

fn next(&mut self) -> Option<Self::Item> {
if self.current <= SIG_MAXSIG {
let signal = Signal(unsafe { NonZeroI32::new_unchecked(self.current) });
self.current += 1;
Some(signal)
} else {
None
if self.current > SIG_MAXSIG {
return None;
}

let sig = Signal::new(self.current);
self.current += 1;

sig
}

fn size_hint(&self) -> (usize, Option<usize>) {
Expand Down

0 comments on commit 31009e5

Please sign in to comment.