stagit

refs_cmp: simplify check, functionally the same

Hiltjo Posthuma contact@arjunchoudhary.com

commit: d165c05 parent: 83c6b88
1 files changed, 3 insertions(+), 6 deletions(-)
Mstagit.c+3-6
M · stagit.c +3, -6
 1@@ -883,13 +883,10 @@ refs_cmp(const void *v1, const void *v2)
 2 {
 3 	git_reference *r1 = (*(git_reference **)v1);
 4 	git_reference *r2 = (*(git_reference **)v2);
 5-	int t1, t2;
 6-
 7-	t1 = git_reference_is_branch(r1);
 8-	t2 = git_reference_is_branch(r2);
 9+	int r;
10 
11-	if (t1 != t2)
12-		return t1 - t2;
13+	if ((r = git_reference_is_branch(r1) - git_reference_is_branch(r2)))
14+		return r;
15 
16 	return strcmp(git_reference_shorthand(r1),
17 	              git_reference_shorthand(r2));