Don't scan entire pattern string for negation

Trivial performance fix.