From: Jakub Pawlowicz Date: Sat, 31 Dec 2016 10:34:32 +0000 (+0100) Subject: See #829 - another performance optimization. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2e56d85d97e714db1fd827c69366c4fc3ab55f3e;p=clean-css.git See #829 - another performance optimization. Why: * Well, if a selector doesn't have a colon there is no point looking for any pseudo classes/elements. --- diff --git a/lib/optimizer/is-mergeable.js b/lib/optimizer/is-mergeable.js index 789ad3bc..11b26e28 100644 --- a/lib/optimizer/is-mergeable.js +++ b/lib/optimizer/is-mergeable.js @@ -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; } }