Skip to content

Commit

Permalink
simplify removal of "Apple"
Browse files Browse the repository at this point in the history
  • Loading branch information
masiboss committed Dec 7, 2023
1 parent 5beb9e1 commit 5902484
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/osx/btop_collect.cpp
Expand Up @@ -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();

Expand All @@ -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, " ", " ");
}
Expand Down

0 comments on commit 5902484

Please sign in to comment.