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

Function name_scope_range

src/pipeline/doc_links_cs.c:4506–4531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4504}
4505
4506static size_t name_scope_range(const cs_index_t *ix, const char *name, size_t *end) {
4507 size_t lo = 0;
4508 size_t hi = ix->nname_scopes;
4509 while (lo < hi) {
4510 cs_work(SKIP_ONE);
4511 size_t mid = lo + (hi - lo) / PAIR_LEN;
4512 if (strcmp(ix->name_scopes[mid].name, name) < 0) {
4513 lo = mid + SKIP_ONE;
4514 } else {
4515 hi = mid;
4516 }
4517 }
4518 size_t first = lo;
4519 hi = ix->nname_scopes;
4520 while (lo < hi) {
4521 cs_work(SKIP_ONE);
4522 size_t mid = lo + (hi - lo) / PAIR_LEN;
4523 if (strcmp(ix->name_scopes[mid].name, name) <= 0) {
4524 lo = mid + SKIP_ONE;
4525 } else {
4526 hi = mid;
4527 }
4528 }
4529 *end = lo;
4530 return first;
4531}
4532
4533/* IDs are accumulated before any result is added: if growth fails, a full
4534 * scan can retry without duplicating a partially resolved candidate set. */

Callers 1

level_usingsFunction · 0.85

Calls 1

cs_workFunction · 0.85

Tested by

no test coverage detected