From: Hiltjo Posthuma Date: Sat, 21 May 2016 16:37:53 +0000 (+0200) Subject: refs_cmp: simplify check, functionally the same X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=837427b09ea3a592e9b364b180c2011b517ab2c8;p=forks%2Fstagit.git refs_cmp: simplify check, functionally the same --- diff --git a/stagit.c b/stagit.c index f97ade9..e20c370 100644 --- a/stagit.c +++ b/stagit.c @@ -883,13 +883,10 @@ refs_cmp(const void *v1, const void *v2) { git_reference *r1 = (*(git_reference **)v1); git_reference *r2 = (*(git_reference **)v2); - int t1, t2; - - t1 = git_reference_is_branch(r1); - t2 = git_reference_is_branch(r2); + int r; - if (t1 != t2) - return t1 - t2; + if ((r = git_reference_is_branch(r1) - git_reference_is_branch(r2))) + return r; return strcmp(git_reference_shorthand(r1), git_reference_shorthand(r2));