@@ -3071,31 +3071,14 @@ static void scan_alternation_labels(cbm_store_t *store, const char *project, con
30713071 free (copy );
30723072}
30733073
3074- static void scan_pattern_nodes (cbm_store_t * store , const char * project , int max_rows ,
3075- cbm_node_pattern_t * first , cbm_node_t * * out_nodes , int * out_count ) {
3074+ static void scan_pattern_nodes (cbm_store_t * store , const char * project , cbm_node_pattern_t * first ,
3075+ cbm_node_t * * out_nodes , int * out_count ) {
30763076 if (first -> label && strchr (first -> label , '|' )) {
30773077 scan_alternation_labels (store , project , first -> label , out_nodes , out_count );
30783078 } else if (first -> label ) {
30793079 cbm_store_find_nodes_by_label (store , project , first -> label , out_nodes , out_count );
30803080 } else {
3081- cbm_search_params_t params = {.project = project ,
3082- .min_degree = CYP_FOUND_NONE ,
3083- .max_degree = CYP_FOUND_NONE ,
3084- .limit = max_rows * CYP_GROWTH_10 };
3085- cbm_search_output_t sout = {0 };
3086- cbm_store_search (store , & params , & sout );
3087- * out_count = sout .count ;
3088- * out_nodes = malloc (sout .count * sizeof (cbm_node_t ));
3089- for (int i = 0 ; i < sout .count ; i ++ ) {
3090- (* out_nodes )[i ] = sout .results [i ].node ;
3091- sout .results [i ].node .name = NULL ;
3092- sout .results [i ].node .project = NULL ;
3093- sout .results [i ].node .label = NULL ;
3094- sout .results [i ].node .qualified_name = NULL ;
3095- sout .results [i ].node .file_path = NULL ;
3096- sout .results [i ].node .properties_json = NULL ;
3097- }
3098- cbm_store_search_free (& sout );
3081+ cbm_store_find_nodes (store , project , out_nodes , out_count );
30993082 }
31003083 /* Apply inline property filters — free rejected nodes' strings */
31013084 if (first -> prop_count > 0 ) {
@@ -4779,7 +4762,7 @@ static int expand_additional_patterns(cbm_store_t *store, cbm_query_t *q, const
47794762
47804763 cbm_node_t * extra_nodes = NULL ;
47814764 int extra_count = 0 ;
4782- scan_pattern_nodes (store , project , max_rows , & patn -> nodes [0 ], & extra_nodes , & extra_count );
4765+ scan_pattern_nodes (store , project , & patn -> nodes [0 ], & extra_nodes , & extra_count );
47834766 int rc = 0 ;
47844767 if (patn -> rel_count == 0 ) {
47854768 rc = cross_join_nodes (bindings , bind_count , extra_nodes , extra_count , nvar , opt );
@@ -4831,7 +4814,7 @@ static int execute_single(cbm_store_t *store, cbm_query_t *q, const char *projec
48314814 /* Step 1: Scan initial nodes */
48324815 cbm_node_t * scanned = NULL ;
48334816 int scan_count = 0 ;
4834- scan_pattern_nodes (store , project , max_rows , & pat0 -> nodes [0 ], & scanned , & scan_count );
4817+ scan_pattern_nodes (store , project , & pat0 -> nodes [0 ], & scanned , & scan_count );
48354818
48364819 /* Build initial bindings with early WHERE */
48374820 int bind_cap = scan_count > max_rows ? scan_count : (max_rows > 0 ? max_rows : SKIP_ONE );
0 commit comments