Adds faster selectors processing in advanced optimizer.
authorJakub Pawlowicz <jakub@goalsmashers.com>
Wed, 19 Feb 2014 07:43:26 +0000 (07:43 +0000)
committerJakub Pawlowicz <jakub@goalsmashers.com>
Wed, 19 Feb 2014 07:43:26 +0000 (07:43 +0000)
Selectors clean up is not needed in case of a single selector being processed.

History.md
lib/selectors/optimizer.js

index 5486e30..274ef27 100644 (file)
@@ -1,6 +1,7 @@
 [2.1.1 / 2014-xx-xx (UNRELEASED)](https://github.com/GoalSmashers/clean-css/compare/v2.1.0...v2.1.1)
 ==================
 
+* Adds faster selectors processing in advanced optimizer.
 * Fixed issue [#241](https://github.com/GoalSmashers/clean-css/issues/241) - incorrect handling of :not() selectors.
 
 [2.1.0 / 2014-02-13](https://github.com/GoalSmashers/clean-css/compare/v2.0.8...v2.1.0)
index 6fc3898..fe394cf 100644 (file)
@@ -13,6 +13,9 @@ module.exports = function Optimizer(data, context, options) {
   var propertyOptimizer = new PropertyOptimizer();
 
   var cleanUpSelector = function(selectors) {
+    if (selectors.indexOf(',') == -1)
+      return selectors;
+
     var plain = [];
     var cursor = 0;
     var lastComma = 0;