1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +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 56c7200837
commit e0a4b67e11

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)