| 1828 | } |
| 1829 | |
| 1830 | static bool gf_batch_sift(gf_batch_work_t *work, size_t root, size_t count, |
| 1831 | cbm_git_facts_error_t *error) { |
| 1832 | gf_batch_pick_t *picks = work->picks; |
| 1833 | size_t width = work->facts->identity.oid_hex_length; |
| 1834 | while (root < count / 2) { |
| 1835 | if (!gf_gate(work->facts, error)) |
| 1836 | return false; |
| 1837 | size_t child = root * 2 + 1; |
| 1838 | if (child + 1 < count && gf_batch_pick_compare(&picks[child], &picks[child + 1], width) < 0) |
| 1839 | child++; |
| 1840 | if (gf_batch_pick_compare(&picks[root], &picks[child], width) >= 0) |
| 1841 | return true; |
| 1842 | gf_batch_pick_t swap = picks[root]; |
| 1843 | picks[root] = picks[child]; |
| 1844 | picks[child] = swap; |
| 1845 | root = child; |
| 1846 | } |
| 1847 | return true; |
| 1848 | } |
| 1849 | |
| 1850 | static bool gf_batch_sort(gf_batch_work_t *work, cbm_git_facts_error_t *error) { |
| 1851 | size_t count = work->request->count; |
no test coverage detected