
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
C++ | size: 0.40 KB | hits: 23 | expires: Never
bool matches(char ca) {
switch(T) {
case Lit: return c == ca;
case Opt: return (set & (1 << (ca - 'a'))) != 0;
}
}
replacing THIS
// if(!M[i].matches(word[i])) return false;
manual inlining HERE
Match &ma = M[i];
switch(ma.T) {
case Lit: if(ma.c != word[i]) return false;
case Opt: if(!((ma.set & (1 << (word[i] - 'a'))) != 0)) return false;
}