aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2020-05-03 14:19:59 -0700
committerLeandro Pereira <leandro@hardinfo.org>2020-05-03 14:31:22 -0700
commitac8b73c5bde3165009f678dd6b3aa06b0b970e3b (patch)
tree2cef53299c74b13344991cf22b4d9537e55f8df2 /modules/benchmark
parentc207bb93a0f1e71c9d7a4ca2bf9bbdefcb0de554 (diff)
Move "need to cleanup CPU name" code to a helper function
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/bench_results.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index 8637fd6b..9c5121a9 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -275,6 +275,12 @@ static int guess_threads_old_result(const char *bench_name,
return threads_available;
}
+static gboolean cpu_name_needs_cleanup(const char *cpu_name)
+{
+ return strstr(cpu_name, "Intel") || strstr(cpu_name, "AMD") ||
+ strstr(cpu_name, "VIA") || strstr(cpu_name, "Cyrix");
+}
+
bench_result *
bench_result_benchmarkconf(const char *section, const char *key, char **values)
{
@@ -382,14 +388,9 @@ bench_result_benchmarkconf(const char *section, const char *key, char **values)
b->machine->processors = -1;
b->machine->cores = -1;
- /* clean the old result's CPU model name
- * if it was probably an x86 */
- if (strstr(b->machine->cpu_name, "Intel") ||
- strstr(b->machine->cpu_name, "AMD") ||
- strstr(b->machine->cpu_name, "VIA") ||
- strstr(b->machine->cpu_name, "Cyrix")) {
+ /* clean the old result's CPU model name if it was probably an x86 */
+ if (cpu_name_needs_cleanup(b->machine->cpu_name))
nice_name_x86_cpuid_model_string(b->machine->cpu_name);
- }
}
b->machine->cpu_config =