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

Function scan_pattern_nodes

src/cypher/cypher.c:3075–3099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3073}
3074
3075static void scan_pattern_nodes(cbm_store_t *store, const char *project, cbm_node_pattern_t *first,
3076 cbm_node_t **out_nodes, int *out_count) {
3077 if (first->label && strchr(first->label, '|')) {
3078 scan_alternation_labels(store, project, first->label, out_nodes, out_count);
3079 } else if (first->label) {
3080 cbm_store_find_nodes_by_label(store, project, first->label, out_nodes, out_count);
3081 } else {
3082 cbm_store_find_nodes(store, project, out_nodes, out_count);
3083 }
3084 /* Apply inline property filters — free rejected nodes' strings */
3085 if (first->prop_count > 0) {
3086 int kept = 0;
3087 for (int i = 0; i < *out_count; i++) {
3088 if (check_inline_props(&(*out_nodes)[i], first->props, first->prop_count, store)) {
3089 if (kept != i) {
3090 (*out_nodes)[kept] = (*out_nodes)[i];
3091 }
3092 kept++;
3093 } else {
3094 node_fields_free(&(*out_nodes)[i]);
3095 }
3096 }
3097 *out_count = kept;
3098 }
3099}
3100
3101/* ── Expand one pattern's relationships on a set of bindings ──── */
3102

Callers 2

execute_singleFunction · 0.85

Calls 5

scan_alternation_labelsFunction · 0.85
cbm_store_find_nodesFunction · 0.85
check_inline_propsFunction · 0.85
node_fields_freeFunction · 0.85

Tested by

no test coverage detected