Skip to content
This repository

Remove never called string #496

Merged
merged 1 commit into from about 1 year ago

2 participants

Egor Homakov James Tucker
Egor Homakov

Previous check p.empty? makes sure that p contains at least 1 symbol.
After .split('=', 2) k or v or both will turn into some string which means k || v will always return true and next will never be called.

Egor Homakov Remove never called string
Previous check `p.empty?` makes sure that p contains at least 1 symbol.
After `.split('=', 2)` k or v or both will turn into some string which means `k || v` will always return true and `next` will never be called.
32a9d08
James Tucker raggi merged commit 50a1483 into from January 21, 2013
James Tucker raggi closed this January 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 14, 2013
Egor Homakov Remove never called string
Previous check `p.empty?` makes sure that p contains at least 1 symbol.
After `.split('=', 2)` k or v or both will turn into some string which means `k || v` will always return true and `next` will never be called.
32a9d08
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 0 additions and 1 deletion. Show diff stats Hide diff stats

  1. 1  lib/rack/utils.rb
1  lib/rack/utils.rb
@@ -70,7 +70,6 @@ def parse_query(qs, d = nil, &unescaper)
70 70
       (qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p|
71 71
         next if p.empty?
72 72
         k, v = p.split('=', 2).map(&unescaper)
73  
-        next unless k || v
74 73
 
75 74
         if cur = params[k]
76 75
           if cur.class == Array
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.