refactor: don't use subtraction in qsort() comparison functions

This commit is contained in:
zeertzjq
2024-02-10 21:38:48 +08:00
parent f3982ad3f3
commit 00e785b17f
6 changed files with 36 additions and 17 deletions

View File

@@ -1875,9 +1875,7 @@ static int compare_file_marks(const void *a, const void *b)
const FileMarks *const *const b_fms = b;
return ((*a_fms)->greatest_timestamp == (*b_fms)->greatest_timestamp
? 0
: ((*a_fms)->greatest_timestamp > (*b_fms)->greatest_timestamp
? -1
: 1));
: ((*a_fms)->greatest_timestamp > (*b_fms)->greatest_timestamp ? -1 : 1));
}
/// Parse msgpack object that has given length