See #829 - another performance optimization.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sat, 31 Dec 2016 10:34:32 +0000 (11:34 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Sat, 31 Dec 2016 10:34:32 +0000 (11:34 +0100)
Why:

* Well, if a selector doesn't have a colon there is no point
  looking for any pseudo classes/elements.

lib/optimizer/is-mergeable.js

index 789ad3b..11b26e2 100644 (file)
@@ -31,7 +31,7 @@ function isMergeable(selector, mergeablePseudoClasses, mergeablePseudoElements)
 
     if (singleSelector.length === 0 ||
         isDeepSelector(singleSelector) ||
-        !areMergeable(singleSelector, extractPseudoFrom(singleSelector), mergeablePseudoClasses, mergeablePseudoElements)) {
+        (singleSelector.indexOf(Marker.COLON) > -1 && !areMergeable(singleSelector, extractPseudoFrom(singleSelector), mergeablePseudoClasses, mergeablePseudoElements))) {
       return false;
     }
   }