Skip to content

Commit

Permalink
Index into source instead of buf
Browse files Browse the repository at this point in the history
So we can take advantage of the UTF32 encoding.
  • Loading branch information
schneems committed Nov 14, 2017
1 parent e59e64d commit 3e75ea2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sprockets/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def concat_javascript_sources(buf, source)
source = source.encode(Encoding::UTF_32LE) unless source.ascii_only?
return buf if string_end_with_semicolon?(source)

if whitespace = WHITESPACE_ORDINALS[buf[-1].ord]
if whitespace = WHITESPACE_ORDINALS[source[-1].ord]
buf[-1] = ";#{whitespace}"
else
buf << ";"
Expand Down

0 comments on commit 3e75ea2

Please sign in to comment.