about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui-refs.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ui-refs.c b/ui-refs.c
index e8e308e..0da063f 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -11,18 +11,10 @@
 #include "html.h"
 #include "ui-shared.h"
 
-static int cmp_age(int age1, int age2)
+static inline int cmp_age(int age1, int age2)
 {
-	if (age1 != 0 && age2 != 0)
-		return age2 - age1;
-
-	if (age1 == 0 && age2 == 0)
-		return 0;
-
-	if (age1 == 0)
-		return +1;
-
-	return -1;
+	/* age1 and age2 are assumed to be non-negative */
+	return age2 - age1;
 }
 
 static int cmp_ref_name(const void *a, const void *b)
td>June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe