diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-02-26 16:57:15 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-02-26 16:57:15 +0100 |
commit | 493061102653ac6483dc3c9649c726318e2488b6 (patch) | |
tree | d84a326c43c297d240b6d26e7d82075fa9fd8c28 /filters/email-gravatar.py | |
parent | 3e9578e9a3393eaebc658ad650a3241bf1930176 (diff) | |
download | cgit-493061102653ac6483dc3c9649c726318e2488b6.tar.gz cgit-493061102653ac6483dc3c9649c726318e2488b6.tar.bz2 |
ui-refs: simplify cmp_age logic
The check in parse_user that eventually makes it into committer_date and
tagger_date is:
else if (mode == 3 && isdigit(*p)) {
*date = atol(p);
mode++;
}
Since isdigit('-') is always false, date will never be negative. Thus
the sign of this function:
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;
}
Will always be the same as the sign of this function:
static inline int cmp_age(int age1, int age2)
{
return age2 - age1;
}
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Idea-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'filters/email-gravatar.py')
0 files changed, 0 insertions, 0 deletions