Skip to content

Commit

Permalink
Enable frozen_string_literal in all files (#49)
Browse files Browse the repository at this point in the history
I was surprised to see erb show up when I was using memory_profiler on
my app. ERB::Compiler#compile has a blank string literal, and it
ended up allocating some 41532 blank strings for a relatively small surface
area.
  • Loading branch information
technicalpickles authored Aug 22, 2023
1 parent 3d3df5c commit b7e45c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/erb/compiler.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#--
# ERB::Compiler
#
Expand Down
1 change: 1 addition & 0 deletions lib/erb/def_method.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#--
# ERB::DefMethod
#
Expand Down
1 change: 1 addition & 0 deletions lib/erb/util.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#--
# ERB::Escape
#
Expand Down

0 comments on commit b7e45c2

Please sign in to comment.