diff options
author | Erik Michaels-Ober <sferik@gmail.com> | 2014-09-29 16:07:18 +0200 |
---|---|---|
committer | Erik Michaels-Ober <sferik@gmail.com> | 2014-09-29 17:27:10 +0200 |
commit | e2b49b203f2cb6cef93283f14838f21bf6ffb4a2 (patch) | |
tree | 14d3101aca1464d140a824e6c859cecef425bfc8 /actionpack/lib | |
parent | 3b451fc0fd4a507016b5a6fe61bb4a8ae388c099 (diff) | |
download | rails-e2b49b203f2cb6cef93283f14838f21bf6ffb4a2.tar.gz rails-e2b49b203f2cb6cef93283f14838f21bf6ffb4a2.tar.bz2 rails-e2b49b203f2cb6cef93283f14838f21bf6ffb4a2.zip |
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.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ <tr> <td> <pre class="line_numbers"> - <% extract_source[:code].keys.each do |line_number| %> + <% extract_source[:code].each_key do |line_number| %> <span><%= line_number -%></span> <% end %> </pre> |