diff options
| author | Edward Thomson <ethomson@github.com> | 2016-10-07 16:01:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-07 16:01:28 +0100 |
| commit | 45dc219f656ff05c06246eec2b36e6805cdf8012 (patch) | |
| tree | 0866d7a31fd9f8208948545bb3cdd76b2cdb4d92 /src/commit_list.c | |
| parent | d11fcf867ba1397928fa18cf45695ff8db32ae44 (diff) | |
| parent | fedc05c89ceb545f29c57bf35ffd066bd9e49386 (diff) | |
| download | libgit2-45dc219f656ff05c06246eec2b36e6805cdf8012.tar.gz | |
Merge pull request #3921 from libgit2/cmn/walk-limit-enough
Improve revision walk preparation logic
Diffstat (limited to 'src/commit_list.c')
| -rw-r--r-- | src/commit_list.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/commit_list.c b/src/commit_list.c index 28948c88b..a1681ffae 100644 --- a/src/commit_list.c +++ b/src/commit_list.c @@ -13,10 +13,15 @@ int git_commit_list_time_cmp(const void *a, const void *b) { - const git_commit_list_node *commit_a = a; - 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; - return (commit_a->time < commit_b->time); + if (time_a < time_b) + return 1; + if (time_a > time_b) + return -1; + + return 0; } git_commit_list *git_commit_list_insert(git_commit_list_node *item, git_commit_list **list_p) |
