Skip to content

Commit

Permalink
remove unused status_continue variable
Browse files Browse the repository at this point in the history
it only gets set immediately before exiting and is only checked before each loop
  • Loading branch information
ntBre committed Dec 30, 2023
1 parent 13d3484 commit 7bfdc36
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions blocks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mod config;
struct Globals<const N: usize> {
statusbar: [String; N],
statusstr: [String; 2],
status_continue: bool,
}

impl<const N: usize> Globals<N> {
Expand All @@ -28,7 +27,6 @@ impl<const N: usize> Globals<N> {
Self {
statusbar: [S; N],
statusstr: [S; 2],
status_continue: true,
}
}

Expand Down Expand Up @@ -75,13 +73,11 @@ impl<const N: usize> Globals<N> {

fn statusloop(&mut self) {
setupsignals();
let mut i = 0;
self.getcmds(-1);
while self.status_continue {
for i in 0.. {
self.getcmds(i);
self.writestatus();
sleep(Duration::from_secs(1));
i += 1;
}
}
}
Expand All @@ -93,9 +89,6 @@ fn get_handler(handler: extern "C" fn(c_int)) -> sighandler_t {
}

extern "C" fn termhandler(_: c_int) {
unsafe {
GLOB.status_continue = false;
}
std::process::exit(0);
}

Expand Down

0 comments on commit 7bfdc36

Please sign in to comment.