Fixed: coretemp ordering

This commit is contained in:
aristocratos 2021-11-27 18:24:40 +01:00
parent 1bce1be695
commit 9465e9b014
1 changed files with 10 additions and 1 deletions

View File

@ -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")) {