Commit 36b01633 authored by Geoff Simmons's avatar Geoff Simmons

Prune the QP prefix sub-branch search more efficiently.

parent 83364942
......@@ -458,15 +458,14 @@ QP_Prefixes(const struct qp_y * const restrict root,
continue;
yy = y->branch[i];
CHECK_OBJ_NOTNULL(yy, QP_Y_MAGIC);
if (yy->off + yy-> len != l)
if (!yy->term || yy->off + yy-> len != l)
continue;
if (yy->term) {
if (strncmp(subject, strings[yy->idx], l) != 0)
return (0);
assert(l != len);
if (update_match(match, yy->idx, len, l) != 0)
return (-1);
}
if (strncmp(subject, strings[yy->idx], l) != 0)
return (0);
assert(l != len);
if (update_match(match, yy->idx, len, l) != 0)
return (-1);
break;
}
if (idx == -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment