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

Function candidate_scope

src/pipeline/doc_links_cs.c:4574–4597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4572}
4573
4574static bool candidate_scope(const cs_using_id_t *rows, size_t n, int scope,
4575 cs_candidate_ids_t *ids) {
4576 size_t lo = 0;
4577 size_t hi = n;
4578 while (lo < hi) {
4579 cs_work(SKIP_ONE);
4580 size_t mid = lo + (hi - lo) / PAIR_LEN;
4581 if (rows[mid].scope < scope) {
4582 lo = mid + SKIP_ONE;
4583 } else {
4584 hi = mid;
4585 }
4586 }
4587 for (size_t i = lo; i < n; i++) {
4588 cs_work(SKIP_ONE);
4589 if (rows[i].scope != scope) {
4590 break;
4591 }
4592 if (!candidate_add(ids, rows[i].id)) {
4593 return false;
4594 }
4595 }
4596 return true;
4597}
4598
4599static int candidate_id_cmp(const void *a, const void *b) {
4600 cs_work(SKIP_ONE);

Callers 1

level_usingsFunction · 0.85

Calls 2

cs_workFunction · 0.85
candidate_addFunction · 0.85

Tested by

no test coverage detected