Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a perf bug with CommentNode#normalize_indentation.

When a single line had ridiculously long preceding whitespace,

Closes #337
  • Loading branch information...
commit a69ebc640121f78632f8000cbafb16237e5e5526 1 parent 5b3ff8f
@nex3 nex3 authored
Showing with 3 additions and 1 deletion.
  1. +2 −0  doc-src/SASS_CHANGELOG.md
  2. +1 −1  lib/sass/tree/comment_node.rb
View
2  doc-src/SASS_CHANGELOG.md
@@ -10,6 +10,8 @@
* Support the `@-moz-document` directive's non-standard `url-prefix` and
`domain` function syntax.
* Support the [`@supports` directive](http://www.w3.org/TR/css3-conditional/#at-supports).
+* Fix a performance issue when using `/*! */` comments with the Rails asset
+ pipeline.
## 3.1.15
View
2  lib/sass/tree/comment_node.rb
@@ -81,7 +81,7 @@ def normalize_indentation(str)
pre = str.split("\n").inject(str[/^[ \t]*/].split("")) do |pre, line|
line[/^[ \t]*/].split("").zip(pre).inject([]) do |arr, (a, b)|
break arr if a != b
- arr + [a]
+ arr << a
end
end.join
str.gsub(/^#{pre}/, '')
Please sign in to comment.
Something went wrong with that request. Please try again.