summaryrefslogtreecommitdiffstats
path: root/src/freebsd
diff options
context:
space:
mode:
authorΣτέφανος <sofr.stef@cytanet.com.cy>2022-10-04 12:56:14 +0300
committerΣτέφανος <sofr.stef@cytanet.com.cy>2022-10-04 12:56:14 +0300
commitab7fe62e65f363e6161534d58e8de7f98350f964 (patch)
treec1786994ee431e7719c605efa8de0a8029c8547c /src/freebsd
parent36a180033db62743d70f1332fde3ea1102181555 (diff)
Fix variable initialization to 'auto' for getB()
It does not make sense to return a `const bool&` as we are dealing with Boolean literals that are `prvalue`s of type bool. The compiler is smart enough to do the necessary optimizations wherever is applicable.
Diffstat (limited to 'src/freebsd')
-rw-r--r--src/freebsd/btop_collect.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/freebsd/btop_collect.cpp b/src/freebsd/btop_collect.cpp
index 9e5be73..bc01333 100644
--- a/src/freebsd/btop_collect.cpp
+++ b/src/freebsd/btop_collect.cpp
@@ -614,9 +614,9 @@ namespace Mem {
if (Runner::stopping or (no_update and not current_mem.percent.at("used").empty()))
return current_mem;
- auto &show_swap = Config::getB("show_swap");
- auto &show_disks = Config::getB("show_disks");
- auto &swap_disk = Config::getB("swap_disk");
+ auto show_swap = Config::getB("show_swap");
+ auto show_disks = Config::getB("show_disks");
+ auto swap_disk = Config::getB("swap_disk");
auto &mem = current_mem;
static const bool snapped = (getenv("BTOP_SNAPPED") != NULL);
@@ -670,7 +670,7 @@ namespace Mem {
double uptime = system_uptime();
auto &disks_filter = Config::getS("disks_filter");
bool filter_exclude = false;
- // auto &only_physical = Config::getB("only_physical");
+ // auto only_physical = Config::getB("only_physical");
auto &disks = mem.disks;
vector<string> filter;
if (not disks_filter.empty()) {
@@ -806,8 +806,8 @@ namespace Net {
auto collect(const bool no_update) -> net_info & {
auto &net = current_net;
auto &config_iface = Config::getS("net_iface");
- auto &net_sync = Config::getB("net_sync");
- auto &net_auto = Config::getB("net_auto");
+ auto net_sync = Config::getB("net_sync");
+ auto net_auto = Config::getB("net_auto");
auto new_timestamp = time_ms();
if (not no_update and errors < 3) {
@@ -1080,11 +1080,11 @@ namespace Proc {
//* Collects and sorts process information from /proc
auto collect(const bool no_update) -> vector<proc_info> & {
const auto &sorting = Config::getS("proc_sorting");
- const auto &reverse = Config::getB("proc_reversed");
+ auto reverse = Config::getB("proc_reversed");
const auto &filter = Config::getS("proc_filter");
- const auto &per_core = Config::getB("proc_per_core");
- const auto &tree = Config::getB("proc_tree");
- const auto &show_detailed = Config::getB("show_detailed");
+ auto per_core = Config::getB("proc_per_core");
+ auto tree = Config::getB("proc_tree");
+ auto show_detailed = Config::getB("show_detailed");
const size_t detailed_pid = Config::getI("detailed_pid");
bool should_filter = current_filter != filter;
if (should_filter) current_filter = filter;