Skip to content

Commit

Permalink
Fixed: coretemp ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Nov 27, 2021
1 parent 1bce1be commit 9465e9b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,16 @@ namespace Cpu {
}
catch (...) {}

if (not got_coretemp or core_sensors.empty()) cpu_temp_only = true;
if (not got_coretemp or core_sensors.empty()) {
cpu_temp_only = true;
}
else {
rng::sort(core_sensors, rng::less{});
rng::stable_sort(core_sensors, [](const auto& a, const auto& b){
return a.size() < b.size();
});
}

if (cpu_sensor.empty() and not found_sensors.empty()) {
for (const auto& [name, sensor] : found_sensors) {
if (s_contains(str_to_lower(name), "cpu") or s_contains(str_to_lower(name), "k10temp")) {
Expand Down

0 comments on commit 9465e9b

Please sign in to comment.