| 2194 | } |
| 2195 | |
| 2196 | static bool lsp_idx_insert_leaf(CBMHashTable *index, CBMResolvedCall *candidate, const char *leaf, |
| 2197 | bool exact_site, const cbm_gbuf_t *gbuf, const char *project_name, |
| 2198 | bool allow_tail_match) { |
| 2199 | if (!index || !candidate || !candidate->caller_qn || !leaf || !leaf[0]) { |
| 2200 | return false; |
| 2201 | } |
| 2202 | char *key = lsp_idx_key(candidate->caller_qn, leaf, exact_site, candidate->site_start_byte, |
| 2203 | candidate->site_end_byte, candidate->source_origin); |
| 2204 | if (!key) { |
| 2205 | return false; |
| 2206 | } |
| 2207 | bool inserted = lsp_idx_keep_best(index, key, candidate, gbuf, project_name, allow_tail_match); |
| 2208 | free(key); |
| 2209 | return inserted; |
| 2210 | } |
| 2211 | |
| 2212 | static const CBMResolvedCall *lsp_idx_lookup(const CBMHashTable *index, const CBMCall *call, |
| 2213 | bool exact_site, bool *key_built, bool *ambiguous) { |
no test coverage detected