From 7cdb2ec9636288dce25836c3ec0f261537a6425f Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 21 Sep 2015 14:00:52 -0700 Subject: remove `blank?` calls on `==` Since Mime::Type implements `method_missing`, and `blank?` triggers it's positive branch: https://github.com/rails/rails/blob/f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e/actionpack/lib/action_dispatch/http/mime_type.rb#L342 We should stop calling `blank?`. --- actionpack/lib/action_dispatch/http/mime_type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index a25b6c8883..2d49ad661c 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -313,7 +313,7 @@ to: end def ==(mime_type) - return false if mime_type.blank? + return false unless mime_type (@synonyms + [ self ]).any? do |synonym| synonym.to_s == mime_type.to_s || synonym.to_sym == mime_type.to_sym end -- cgit v1.2.3