Skip to content

Commit

Permalink
Optimize string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Feb 21, 2025
1 parent 0ad3e2b commit 9eb4fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sassc/embedded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def render
@loaded_urls = result.loaded_urls
@source_map = result.source_map

css = result.css
css += "\n" unless css.empty?
css = +result.css
css << "\n" unless css.empty?
unless @source_map.nil? || omit_source_map_url?
source_mapping_url = if source_map_embed?
"data:application/json;base64,#{[@source_map].pack('m0')}"
else
Uri.file_urls_to_relative_url(source_map_file_url, file_url)
end
css += "\n/*# sourceMappingURL=#{source_mapping_url} */"
css << "\n/*# sourceMappingURL=#{source_mapping_url} */"
end
css.encode(@template.encoding)
css.encode!(@template.encoding)
rescue ::Sass::CompileError => e
@loaded_urls = e.loaded_urls

Expand Down

0 comments on commit 9eb4fee

Please sign in to comment.