From 61b65dc913a9997134417d7ecc6d6d8a097c64a2 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sun, 3 May 2020 11:04:12 -0700 Subject: Misc. cleanups in benchmark.c --- modules/benchmark.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/benchmark.c b/modules/benchmark.c index 6bf41d45..6c457357 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -330,18 +330,14 @@ bench_value benchmark_parallel_for(gint n_threads, gchar *hi_more_info(gchar *entry) { - gchar *info = moreinfo_lookup_with_prefix("BENCH", entry); - if (info) - return g_strdup(info); - return g_strdup("?"); + const gchar *info = moreinfo_lookup_with_prefix("BENCH", entry); + return g_strdup(info ? info : "?"); } gchar *hi_get_field(gchar *field) { - gchar *info = moreinfo_lookup_with_prefix("BENCH", field); - if (info) - return g_strdup(info); - return g_strdup(field); + const gchar *info = moreinfo_lookup_with_prefix("BENCH", field); + return g_strdup(info ? info : field); } static void br_mi_add(char **results_list, bench_result *b, gboolean select) -- cgit v1.2.3