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

Function find_node_index

src/ui/layout3d.c:484–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484static int find_node_index(const node_id_entry_t *map, int count, int64_t id) {
485 int lo = 0;
486 int hi = count - SKIP_ONE;
487 while (lo <= hi) {
488 int mid = lo + (hi - lo) / PAIR_LEN;
489 if (map[mid].id == id) {
490 return map[mid].idx;
491 }
492 if (map[mid].id < id) {
493 lo = mid + SKIP_ONE;
494 } else {
495 hi = mid - SKIP_ONE;
496 }
497 }
498 return CBM_NOT_FOUND;
499}
500
501/* ── Public API ───────────────────────────────────────────────── */
502

Callers 1

cbm_layout_from_nodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected