]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - score.c
Simplify row_belongs_to_score_table().
[paraslash.git] / score.c
diff --git a/score.c b/score.c
index 19cfef86212dd867d6dea3c924a0f40ca897a2cd..c7a2411b4282e5c224b8692ab7428f7fff75f3b4 100644 (file)
--- a/score.c
+++ b/score.c
@@ -255,27 +255,20 @@ int score_delete(const struct osl_row *aft_row)
  * Find out whether an audio file is contained in the score table.
  *
  * \param aft_row The row of the audio file table.
- * \param rank Result pointer
  *
- * \return Positive, if \a aft_row belongs to the audio file table,
- * zero if not, negative on errors. If \a aft_row was found, and \a rank
- * is not \p NULL, the rank of \a aft_row is returned in \a rank.
+ * \return If the lookup operation fails for any other reason than "not found",
+ * the function aborts the current process (afs), since this is considered a
+ * fatal error that should never happen.
  */
-int row_belongs_to_score_table(const struct osl_row *aft_row, unsigned *rank)
+bool row_belongs_to_score_table(const struct osl_row *aft_row)
 {
        struct osl_row *score_row;
        int ret = get_score_row_from_aft_row(aft_row, &score_row);
 
        if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_RB_KEY_NOT_FOUND))
-               return 0;
-       if (ret < 0)
-               return ret;
-       if (!rank)
-               return 1;
-       ret = osl(osl_get_rank(score_table, score_row, SCORECOL_SCORE, rank));
-       if (ret < 0)
-               return ret;
-       return 1;
+               return false;
+       assert(ret >= 0);
+       return true;
 }
 
 static void score_close(void)