summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-10-14 14:03:43 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-10-14 14:03:43 -0700
commit2fc2cd725252969e2c04fa666247f7b28dbf7cf6 (patch)
tree6173872ebddbfb811898a388449f1eb856138197
parent6c75ee5446833fa96fc484205465b01edab4c1f0 (diff)
downloadgit-2fc2cd725252969e2c04fa666247f7b28dbf7cf6.tar.gz
remove unnecessary object duplication
`load_from_json` returns a list of newly created MIME::Type objects, so there is no need to loop through all of them again, convert them to hashes, then allocate duplicate MIME::Type objects. <3<3
-rw-r--r--lib/mime/types/loader.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/mime/types/loader.rb b/lib/mime/types/loader.rb
index 32b43ac6e0..1aed4e1d86 100644
--- a/lib/mime/types/loader.rb
+++ b/lib/mime/types/loader.rb
@@ -56,9 +56,7 @@ class MIME::Types::Loader
# This method is aliased to #load.
def load_json
Dir[json_path].sort.each do |f|
- types = self.class.load_from_json(f).map { |type|
- MIME::Type.new(type)
- }
+ types = self.class.load_from_json(f)
container.add(*types, :silent)
end
container