From b09f352c09c14788985e23cd01f2975b2443b810 Mon Sep 17 00:00:00 2001 From: jkre Date: Thu, 14 Dec 2023 00:16:15 +0100 Subject: [PATCH] clean up if statement for battery percent calculation --- src/linux/btop_collect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index 3961d91..212a165 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -771,7 +771,7 @@ namespace Cpu { catch (const std::invalid_argument&) { } 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 { percent = round(100.0 * stoll(readfile(b.charge_now, "-1")) / stoll(readfile(b.charge_full, "1"))); }