summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Nichols <josh@technicalpickles.com>2023-08-21 21:41:06 -0700
committergit <svn-admin@ruby-lang.org>2023-08-22 04:41:22 +0000
commit0955ca342ed01b61161e1a46015a58b54d2e7205 (patch)
treee1ca362f36beb3a392f87b05b22cc40503b9a179
parent925ce3f4fbe2f05b8673a6dbc763ecab9f04fae1 (diff)
[ruby/erb] Enable frozen_string_literal in all files
(https://github.com/ruby/erb/pull/49) 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. https://github.com/ruby/erb/commit/b7e45c2bdc
-rw-r--r--lib/erb/compiler.rb1
-rw-r--r--lib/erb/def_method.rb1
-rw-r--r--lib/erb/util.rb1
3 files changed, 3 insertions, 0 deletions
diff --git a/lib/erb/compiler.rb b/lib/erb/compiler.rb
index 547d2c4c44..7096c8dcea 100644
--- a/lib/erb/compiler.rb
+++ b/lib/erb/compiler.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#--
# ERB::Compiler
#
diff --git a/lib/erb/def_method.rb b/lib/erb/def_method.rb
index 17f9c0f9fa..aee989a926 100644
--- a/lib/erb/def_method.rb
+++ b/lib/erb/def_method.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#--
# ERB::DefMethod
#
diff --git a/lib/erb/util.rb b/lib/erb/util.rb
index 0c1e7482a8..1d2a36275d 100644
--- a/lib/erb/util.rb
+++ b/lib/erb/util.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#--
# ERB::Escape
#