MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / gf_batch_sift

Function gf_batch_sift

src/mcp/test_impact_git.c:1830–1848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1828}
1829
1830static 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
1850static bool gf_batch_sort(gf_batch_work_t *work, cbm_git_facts_error_t *error) {
1851 size_t count = work->request->count;

Callers 1

gf_batch_sortFunction · 0.85

Calls 2

gf_gateFunction · 0.85
gf_batch_pick_compareFunction · 0.85

Tested by

no test coverage detected