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

Function rs_md_base

internal/cbm/doclink_rs.c:1332–1344  ·  view source on GitHub ↗

Column the text of a line is measured from: the content column of the * innermost open list item it reaches. The stack is strictly increasing (an * item opens to the right of everything still open), so this is a binary * search. */

Source from the content-addressed store, hash-verified

1330 * item opens to the right of everything still open), so this is a binary
1331 * search. */
1332static int rs_md_base(const rs_md_t *st, int col) {
1333 int lo = 0;
1334 int hi = st->nlist;
1335 while (lo < hi) {
1336 int mid = lo + ((hi - lo) / PAIR_LEN);
1337 if (st->list[mid] <= col) {
1338 lo = mid + SKIP_ONE;
1339 } else {
1340 hi = mid;
1341 }
1342 }
1343 return lo > 0 ? st->list[lo - SKIP_ONE] : 0;
1344}
1345
1346static void rs_md_push_list(rs_md_t *st, int content) {
1347 if (st->nlist >= st->list_cap) {

Callers 1

rs_md_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected