From 9c4691036a9f8999ec19034fb218e8fcdc393475 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 9 Mar 2022 21:59:18 +0100 Subject: [PATCH] mood.c: Remove pointless check in reload_current_mood(). The function gets only called from the event handler, which returns early without calling reload_current_mood if current_mood and is NULL. --- mood.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mood.c b/mood.c index a58284a7..a535bdcf 100644 --- a/mood.c +++ b/mood.c @@ -672,19 +672,16 @@ out: * This function is called on events which render the current list of * admissible files useless, for example if an attribute is removed from the * attribute table. - * - * If no mood is currently open, the function returns success. */ static int reload_current_mood(void) { int ret; char *mood_name = NULL; + assert(current_mood); ret = clear_score_table(); if (ret < 0) return ret; - if (!current_mood) - return 1; PARA_NOTICE_LOG("reloading %s\n", current_mood->name? current_mood->name : "(dummy)"); if (current_mood->name) -- 2.39.2