| 22 | static const unsigned all_flags = (PARENT1 | PARENT2 | STALE | RESULT | ENQUEUED); |
| 23 | |
| 24 | static int compare_commits_by_gen(const void *_a, const void *_b) |
| 25 | { |
| 26 | const struct commit *a = *(const struct commit * const *)_a; |
| 27 | const struct commit *b = *(const struct commit * const *)_b; |
| 28 | |
| 29 | timestamp_t generation_a = commit_graph_generation(a); |
| 30 | timestamp_t generation_b = commit_graph_generation(b); |
| 31 | |
| 32 | if (generation_a < generation_b) |
| 33 | return -1; |
| 34 | if (generation_a > generation_b) |
| 35 | return 1; |
| 36 | if (a->date < b->date) |
| 37 | return -1; |
| 38 | if (a->date > b->date) |
| 39 | return 1; |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * A prio_queue with O(1) termination check. 'max_nonstale' tracks |
nothing calls this directly
no test coverage detected