mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
daemon: use abs_diff
to remove lossy casts
This commit is contained in:
parent
ad70a85426
commit
8c462868b6
1 changed files with 1 additions and 2 deletions
|
@ -522,8 +522,7 @@ pub fn run_daemon(mut config: AppConfig, verbose: bool) -> Result<(), AppError>
|
||||||
// or if we haven't computed an interval yet
|
// or if we haven't computed an interval yet
|
||||||
if system_history.last_computed_interval.is_none()
|
if system_history.last_computed_interval.is_none()
|
||||||
|| (system_history.last_cpu_volatility - current_cpu_volatility).abs() > 1.0
|
|| (system_history.last_cpu_volatility - current_cpu_volatility).abs() > 1.0
|
||||||
|| (system_history.last_idle_secs as i64 - current_idle_secs as i64).abs()
|
|| u64::abs_diff(system_history.last_idle_secs, current_idle_secs) > 10
|
||||||
> 10
|
|
||||||
{
|
{
|
||||||
let optimal_interval =
|
let optimal_interval =
|
||||||
system_history.calculate_optimal_interval(&config, on_battery);
|
system_history.calculate_optimal_interval(&config, on_battery);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue