]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mood.c: Remove a dead store and fix the documentation of mood_load().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 20 May 2025 20:10:31 +0000 (22:10 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 21 May 2025 16:16:07 +0000 (18:16 +0200)
The function returns 1 on success, not the number of admissible files.

Found by the clang analyzer.

mood.c

diff --git a/mood.c b/mood.c
index 0187bc4c615a82dc8fe4dd6fb17594d7744399fc..01ef2c8ab38c2ad18e42cf0a00117c33069f87e7 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -614,9 +614,8 @@ static void compute_correction_factors(int64_t sse, struct afs_statistics *s)
  * If the message pointer is not NULL, a suitable message is returned there in
  * all cases. The caller must free this string.
  *
- * \return The number of admissible files on success, negative on errors. On
- * errors, the current mood remains unaffected even if result is NULL. It is
- * not considered an error if no files are admissible.
+ * \return Standard. On errors, the current mood remains unaffected even if
+ * result is NULL. It is not considered an error if no files are admissible.
  *
  * \sa \ref mp_eval_row().
  */
@@ -659,7 +658,6 @@ int mood_load(const char *mood_name, struct mood_instance **result, char **msg)
        /* success */
        if (msg)
                *msg = get_statistics(aa.m, rnow.tv_sec);
-       ret = aa.m->stats.num;
        if (result)
                *result = aa.m;
        else {