From 5423f4c5955e0335958b012d80e31a8c50bb8f6b Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Sun, 12 Apr 2015 12:16:42 +0100 Subject: [PATCH] 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%. --- lib/properties/shorthand-compactor.js | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.34.1