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

Function sh_lower_bound

src/pipeline/pass_shell.c:143–155  ·  view source on GitHub ↗

First index whose path is >= key. */

Source from the content-addressed store, hash-verified

141
142/* First index whose path is >= key. */
143static int sh_lower_bound(const sh_paths_t *v, const char *key) {
144 int lo = 0;
145 int hi = v->count;
146 while (lo < hi) {
147 int mid = lo + (hi - lo) / PAIR_LEN;
148 if (strcmp(v->items[mid], key) < 0) {
149 lo = mid + SKIP_ONE;
150 } else {
151 hi = mid;
152 }
153 }
154 return lo;
155}
156
157static bool sh_paths_has(const sh_paths_t *v, const char *p) {
158 int i = sh_lower_bound(v, p);

Callers 2

sh_paths_hasFunction · 0.85
sh_rangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected