Skip to content
This repository
Browse code

Merge pull request #537 from vipulnsward/remove_loop

remove extra loop, variable initialization
  • Loading branch information...
commit a2101458b8dad737aee7c80b4af23d45861649df 2 parents fb76001 + 7c83aca
Konstantin Haase authored April 12, 2013
1  lib/rack/multipart/parser.rb
@@ -87,7 +87,6 @@ def get_current_head_and_filename_and_content_type_and_name_and_body
87 87
         head = nil
88 88
         body = ''
89 89
         filename = content_type = name = nil
90  
-        content = nil
91 90
 
92 91
         until head && @buf =~ rx
93 92
           if !head && i = @buf.index(EOL+EOL)
6  lib/rack/utils.rb
@@ -234,10 +234,8 @@ def select_best_encoding(available_encodings, accept_encoding)
234 234
         encoding_candidates.push("identity")
235 235
       end
236 236
 
237  
-      expanded_accept_encoding.find_all { |m, q|
238  
-        q == 0.0
239  
-      }.each { |m, _|
240  
-        encoding_candidates.delete(m)
  237
+      expanded_accept_encoding.each { |m, q|
  238
+        encoding_candidates.delete(m) if q == 0.0
241 239
       }
242 240
 
243 241
       return (encoding_candidates & available_encodings)[0]

0 notes on commit a210145

Please sign in to comment.
Something went wrong with that request. Please try again.