From 21558e4c5b47a934904c376a13c9eb74bcc0246a Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sat, 9 May 2020 13:39:45 -0700 Subject: GSList will be sorted anyway, so prepend rather than append --- modules/benchmark.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/benchmark.c') diff --git a/modules/benchmark.c b/modules/benchmark.c index a2b975bc..02cb9085 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -543,7 +543,7 @@ static gchar *benchmark_include_results_internal(bench_value this_machine_value, const gchar *benchmark, ShellOrderType order_type) { - bench_result *this_machine = NULL; + bench_result *this_machine; GSList *result_list, *li; gchar *results = g_strdup(""); gchar *output; @@ -565,7 +565,9 @@ static gchar *benchmark_include_results_internal(bench_value this_machine_value, /* this result */ if (this_machine_value.result > 0.0) { this_machine = bench_result_this_machine(benchmark, this_machine_value); - result_list = g_slist_append(result_list, this_machine); + result_list = g_slist_prepend(result_list, this_machine); + } else { + this_machine = NULL; } /* sort */ -- cgit v1.2.3