We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48c6436 commit 5e2a29aCopy full SHA for 5e2a29a
src/commit_list.c
@@ -13,10 +13,15 @@
13
14
int git_commit_list_time_cmp(const void *a, const void *b)
15
{
16
- const git_commit_list_node *commit_a = a;
17
- const git_commit_list_node *commit_b = b;
+ int64_t time_a = ((git_commit_list_node *) a)->time;
+ int64_t time_b = ((git_commit_list_node *) b)->time;
18
19
- return (commit_a->time < commit_b->time);
+ if (time_a < time_b)
20
+ return 1;
21
+ if (time_a > time_b)
22
+ return -1;
23
+
24
+ return 0;
25
}
26
27
git_commit_list *git_commit_list_insert(git_commit_list_node *item, git_commit_list **list_p)
0 commit comments