Skip to content

Commit

Permalink
Fix crashbug - division by zero…
Browse files Browse the repository at this point in the history
…thanks to a screenrecording, a short flash of the error is enough :D.
Should remember that.
Besides, div by zero is by now the most common reason for a crash.
  • Loading branch information
Byron committed Mar 29, 2020
1 parent 164d885 commit 5f2bc2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/interactive/app/eventloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,7 @@ impl TerminalApp {
}
});
s.reset_message();
s.entries = sorted_entries(
&traversal.tree,
s.root,
s.sorting,
);
s.entries = sorted_entries(&traversal.tree, s.root, s.sorting);
s.selected = s.selected.or_else(|| s.entries.get(0).map(|b| b.index));
s
},
Expand Down
2 changes: 1 addition & 1 deletion src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl Traversal {
check_instant_every = (INITIAL_CHECK_INTERVAL as f64
* ((eid - last_seen_eid) as f64 / INITIAL_CHECK_INTERVAL as f64)
* (REFRESH_RATE.as_millis() as f64 / elapsed))
as usize;
.max(1.0) as usize;
last_seen_eid = eid;
last_checked = now;

Expand Down

0 comments on commit 5f2bc2d

Please sign in to comment.