From: Jakub Pawlowicz Date: Sun, 12 Apr 2015 11:16:42 +0000 (+0100) Subject: No shorthand compacting for less than 3 properties. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5423f4c5955e0335958b012d80e31a8c50bb8f6b;p=clean-css.git No shorthand compacting for less than 3 properties. There is no shorthand for 2 properties so there is no way it may shorten the content. It speeds up processing by ~5%. --- diff --git a/lib/properties/shorthand-compactor.js b/lib/properties/shorthand-compactor.js index 2fbe09e8..640db069 100644 --- a/lib/properties/shorthand-compactor.js +++ b/lib/properties/shorthand-compactor.js @@ -76,6 +76,9 @@ function invalidateOrCompact(properties, position, candidates, validator) { function compactShortands(properties, compatibility, validator) { var candidates = {}; + if (properties.length < 3) + return; + for (var i = 0, l = properties.length; i < l; i++) { var property = properties[i]; if (property.unused)