| 3026 | } |
| 3027 | |
| 3028 | static bool lsp_idx_insert_leaf(CBMHashTable *index, CBMResolvedCall *candidate, const char *leaf, |
| 3029 | bool exact_site, const cbm_gbuf_t *gbuf, const char *project_name, |
| 3030 | bool allow_tail_match) { |
| 3031 | if (!index || !candidate || !candidate->caller_qn || !leaf || !leaf[0]) { |
| 3032 | return false; |
| 3033 | } |
| 3034 | char *key = lsp_idx_key(candidate->caller_qn, leaf, exact_site, candidate->site_start_byte, |
| 3035 | candidate->site_end_byte, candidate->source_origin); |
| 3036 | if (!key) { |
| 3037 | return false; |
| 3038 | } |
| 3039 | bool inserted = lsp_idx_keep_best(index, key, candidate, gbuf, project_name, allow_tail_match); |
| 3040 | free(key); |
| 3041 | return inserted; |
| 3042 | } |
| 3043 | |
| 3044 | static const CBMResolvedCall *lsp_idx_lookup(const CBMHashTable *index, const CBMCall *call, |
| 3045 | bool exact_site, bool *key_built, bool *ambiguous) { |
no test coverage detected