* Select the commits that will be bitmapped */
| 1012 | * Select the commits that will be bitmapped |
| 1013 | */ |
| 1014 | static inline unsigned int next_commit_index(unsigned int idx) |
| 1015 | { |
| 1016 | static const unsigned int MIN_COMMITS = 100; |
| 1017 | static const unsigned int MAX_COMMITS = 5000; |
| 1018 | |
| 1019 | static const unsigned int MUST_REGION = 100; |
| 1020 | static const unsigned int MIN_REGION = 20000; |
| 1021 | |
| 1022 | unsigned int offset, next; |
| 1023 | |
| 1024 | if (idx <= MUST_REGION) |
| 1025 | return 0; |
| 1026 | |
| 1027 | if (idx <= MIN_REGION) { |
| 1028 | offset = idx - MUST_REGION; |
| 1029 | return (offset < MIN_COMMITS) ? offset : MIN_COMMITS; |
| 1030 | } |
| 1031 | |
| 1032 | offset = idx - MIN_REGION; |
| 1033 | next = (offset < MAX_COMMITS) ? offset : MAX_COMMITS; |
| 1034 | |
| 1035 | return (next > MIN_COMMITS) ? next : MIN_COMMITS; |
| 1036 | } |
| 1037 | |
| 1038 | static int date_compare(const void *_a, const void *_b) |
| 1039 | { |
no outgoing calls
no test coverage detected