mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-15 09:54:33 +12:00
simplify removal of "Apple"
This commit is contained in:
parent
5beb9e12e5
commit
5902484f39
|
@ -227,11 +227,6 @@ namespace Cpu {
|
|||
name = name_vec.at(cpu_pos + 1);
|
||||
else
|
||||
name.clear();
|
||||
} else if (v_contains(name_vec, "Apple"s)) {
|
||||
auto apple_pos = v_index(name_vec, "Apple"s);
|
||||
name = (apple_pos < name_vec.size() - 1 ? name_vec.at(apple_pos + 1) : "")
|
||||
+ (apple_pos < name_vec.size() - 1 && name_vec.size() > 2 ? ' ' + name_vec.at(apple_pos + 2) : "")
|
||||
+ (apple_pos < name_vec.size() - 1 && name_vec.size() > 3 ? ' ' + name_vec.at(apple_pos + 3) : "");
|
||||
} else
|
||||
name.clear();
|
||||
|
||||
|
@ -241,7 +236,7 @@ namespace Cpu {
|
|||
name += n + ' ';
|
||||
}
|
||||
name.pop_back();
|
||||
for (const auto& replace : {"Processor", "CPU", "(R)", "(TM)", "Intel", "AMD", "Core"}) {
|
||||
for (const auto& replace : {"Processor", "CPU", "(R)", "(TM)", "Intel", "AMD", "Apple", "Core"}) {
|
||||
name = s_replace(name, replace, "");
|
||||
name = s_replace(name, " ", " ");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue