1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Optimize lookup table read

Reread lookup table only when needed.
This commit is contained in:
Zdenek Kabelac 2010-11-29 14:25:13 +00:00
parent b20e74d5d6
commit 2e3be4f3fd

View File

@ -372,11 +372,11 @@ static struct dfa_state *_step_matcher(struct dm_regex *m, int c, struct dfa_sta
{
struct dfa_state *ns;
if (!cs->lookup[(unsigned char) c])
_calc_state(m, cs, (unsigned char) c);
if (!(ns = cs->lookup[(unsigned char) c]))
return NULL;
if (!(ns = cs->lookup[(unsigned char) c])) {
_calc_state(m, cs, (unsigned char) c);
if (!(ns = cs->lookup[(unsigned char) c]))
return NULL;
}
// yuck, we have to special case the target trans
if (ns->final == -1)