aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2014-09-29 16:07:18 +0200
committerErik Michaels-Ober <sferik@gmail.com>2014-09-29 17:27:10 +0200
commite2b49b203f2cb6cef93283f14838f21bf6ffb4a2 (patch)
tree14d3101aca1464d140a824e6c859cecef425bfc8 /actionpack/test/dispatch
parent3b451fc0fd4a507016b5a6fe61bb4a8ae388c099 (diff)
downloadrails-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/test/dispatch')
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index 7f340ced41..ad6335f132 100644
--- a/actionpack/test/dispatch/mime_type_test.rb
+++ b/actionpack/test/dispatch/mime_type_test.rb
@@ -3,7 +3,7 @@ require 'abstract_unit'
class MimeTypeTest < ActiveSupport::TestCase
test "parse single" do
- Mime::LOOKUP.keys.each do |mime_type|
+ Mime::LOOKUP.each_key do |mime_type|
unless mime_type == 'image/*'
assert_equal [Mime::Type.lookup(mime_type)], Mime::Type.parse(mime_type)
end