From: Jakub Pawlowicz Date: Sun, 22 Mar 2015 17:07:02 +0000 (+0000) Subject: Adds small improvements to `reduceNonAdjacent` optimizer. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e9b106fe49e4c13a5e13bebd9094e8c69143a128;p=clean-css.git Adds small improvements to `reduceNonAdjacent` optimizer. --- diff --git a/lib/selectors/optimizers/advanced.js b/lib/selectors/optimizers/advanced.js index ac8036e3..98cb9371 100644 --- a/lib/selectors/optimizers/advanced.js +++ b/lib/selectors/optimizers/advanced.js @@ -97,10 +97,11 @@ AdvancedOptimizer.prototype.reduceNonAdjacent = function (tokens) { if (token[0] != 'selector') continue; - var isComplexAndNotSpecial = token[1].length > 1 && !this.isSpecial(stringifySelector(token[1])); + var selectorAsString = stringifySelector(token[1]); + var isComplexAndNotSpecial = token[1].length > 1 && !this.isSpecial(selectorAsString); var selectors = isComplexAndNotSpecial ? - [stringifySelector(token[1])].concat(token[1]) : - [stringifySelector(token[1])]; + [selectorAsString].concat(token[1]) : + [selectorAsString]; for (var j = 0, m = selectors.length; j < m; j++) { var selector = selectors[j];