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

Function op_span_better

src/pipeline/pass_operator.c:155–164  ·  view source on GitHub ↗

Is span `a` a better enclosing function than `b`: shorter, then (equal * spans of two nodes) the lower QN, so the choice never follows index order. */

Source from the content-addressed store, hash-verified

153/* Is span `a` a better enclosing function than `b`: shorter, then (equal
154 * spans of two nodes) the lower QN, so the choice never follows index order. */
155static bool op_span_better(const op_span_t *a, const op_span_t *b) {
156 int la = a->end - a->start;
157 int lb = b->end - b->start;
158 if (la != lb) {
159 return la < lb;
160 }
161 const char *qa = a->node->qualified_name ? a->node->qualified_name : "";
162 const char *qb = b->node->qualified_name ? b->node->qualified_name : "";
163 return strcmp(qa, qb) < 0;
164}
165
166/* The innermost function of `file` spanning `line`. */
167static const cbm_gbuf_node_t *op_enclosing(CBMHashTable *by_file, const char *file, int line) {

Callers 1

op_enclosingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected