Simplify CSSSelector::isAttributeSelector() by not checking each Match type
Simplify CSSSelector::isAttributeSelector() by not checking each Match type explicitly and reordering the Match enum instead so that the attribute selector match type are contiguous and at the end of the enum. This way, the check can become (m_match >= FirstAttributeSelectorMatch). This optimization is similar to the one we already use in CollectionType.h for collection types. isAttributeSelector() is called from SelectorChecker::checkOne() which is hot code. I see a ~2% progression on Dromaeo's cssquery-jquery: http://dromaeo.com/?id=222514,222518 Review URL: https://codereview.chromium.org/315043005 git-svn-id: svn://svn.chromium.org/blink/trunk@175632 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment