[PATCH] ui-refs.c: Simplify and inline cmp_age()

Jason A. Donenfeld Jason at zx2c4.com
Tue Feb 4 20:26:32 CET 2014


On Tue, Feb 4, 2014 at 8:22 PM, Lukas Fleischer <cgit at cryptocrack.de> wrote:
>
>     return age2 - age1;
> -static 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;
> -}


cmp_age(-1, 0) returns -1

0 - -1 returns 1


More information about the CGit mailing list