mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-17 09:54:57 +12:00
clean up if statement for battery percent calculation
This commit is contained in:
parent
f6d8c4a044
commit
b09f352c09
|
@ -771,7 +771,7 @@ namespace Cpu {
|
||||||
catch (const std::invalid_argument&) { }
|
catch (const std::invalid_argument&) { }
|
||||||
catch (const std::out_of_range&) { }
|
catch (const std::out_of_range&) { }
|
||||||
}
|
}
|
||||||
if (b.use_energy_or_charge == true and percent < 0) {
|
if (b.use_energy_or_charge and percent < 0) {
|
||||||
try {
|
try {
|
||||||
percent = round(100.0 * stoll(readfile(b.charge_now, "-1")) / stoll(readfile(b.charge_full, "1")));
|
percent = round(100.0 * stoll(readfile(b.charge_now, "-1")) / stoll(readfile(b.charge_full, "1")));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue