}
}
- _reduceSimpleNonAdjacentCases(tokens, moreThanOnce, candidates);
- _reduceComplexNonAdjacentCases(tokens, candidates);
+ var reducedInSimple = _reduceSimpleNonAdjacentCases(tokens, moreThanOnce, candidates);
+ var reducedInComplex = _reduceComplexNonAdjacentCases(tokens, candidates);
+
+ minificationsMade.unshift(reducedInSimple || reducedInComplex);
};
var _reduceSimpleNonAdjacentCases = function(tokens, matches, positions) {
+ var reduced = false;
+
for (var i = 0, l = matches.length; i < l; i++) {
var selector = matches[i];
var data = positions[selector];
return data[idx].partial && bodies.length === 0;
},
callback: function(token, newBody, processedCount, tokenIdx) {
- if (!data[processedCount - tokenIdx - 1].partial)
+ if (!data[processedCount - tokenIdx - 1].partial) {
token.body = newBody.join(';');
+ reduced = true;
+ }
}
});
}
+
+ return reduced;
};
var _reduceComplexNonAdjacentCases = function(tokens, positions) {
+ var reduced = false;
+
allSelectors:
for (var complexSelector in positions) {
if (complexSelector.indexOf(',') == -1) // simplification, as :not() can have commas too
}
intoToken.body = reducedBodies[0];
+ reduced = true;
}
+
+ return reduced;
};
var _reduceSelector = function(tokens, selector, data, options) {