From e2b49b203f2cb6cef93283f14838f21bf6ffb4a2 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 29 Sep 2014 16:07:18 +0200 Subject: Use Hash#each_key instead of Hash#keys.each Hash#keys.each allocates an array of keys; Hash#each_key iterates through the keys without allocating a new array. This is the reason why Hash#each_key exists. --- actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb') diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb index 51660a619b..ba29e26930 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb @@ -10,7 +10,7 @@
-                  <% extract_source[:code].keys.each do |line_number| %>
+                  <% extract_source[:code].each_key do |line_number| %>
 <%= line_number -%>
                   <% end %>
                 
-- cgit v1.2.3