]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mood.c: Remove pointless check in reload_current_mood().
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 9 Mar 2022 20:59:18 +0000 (21:59 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 17 Oct 2022 18:36:21 +0000 (20:36 +0200)
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

diff --git a/mood.c b/mood.c
index a58284a75d30f2b0aa008ae69d930b0e90d91edb..a535bdcfe2c5c1dd74470bb3f11ccdeda3e9e01f 100644 (file)
--- 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)