From c68ae2f00b30dbe8bf6bce498e35728a7e4adcb2 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 5 Nov 2018 10:13:24 -0700 Subject: [PATCH] main: Log optimized implementations only when they exist Log optimized implementations strings only when the hashmap contains items in order to avoid an unnecessary line of text with no members printed out. --- src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index a550094c..536d954b 100644 --- a/src/main.c +++ b/src/main.c @@ -337,8 +337,11 @@ static int check_crypto() l_hashmap_foreach(options, print_koption, NULL); - l_info("The following optimized implementations might be available:"); - l_hashmap_foreach(optional, print_koption, NULL); + if (!l_hashmap_isempty(optional)) { + l_info("The following optimized implementations might be " + "available:"); + l_hashmap_foreach(optional, print_koption, NULL); + } done: l_hashmap_destroy(options, NULL);