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. */
| 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. */ |
| 155 | static 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`. */ |
| 167 | static const cbm_gbuf_node_t *op_enclosing(CBMHashTable *by_file, const char *file, int line) { |