Permalink
Browse files

Found some issues with the flipped logic thanks to the type-lessness …

…of SQLite
  • Loading branch information...
1 parent 7c2f08e commit a64b40736952065fc95c87734a039d34b1f27cbd Dan Little committed Aug 13, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/geocoder/us/database.rb
@@ -267,12 +267,12 @@ def range_ends (edge_ids)
FROM range WHERE tlid IN (#{in_list})
GROUP BY tlid, side;"
execute(sql, *edge_ids).map {|r|
- if r[:flipped] == "0"
- r[:flipped] = false
- r[:fromhn], r[:tohn] = r[:from0], r[:to0]
- else
+ if r[:flipped].to_i == 1
r[:flipped] = true
r[:fromhn], r[:tohn] = r[:from1], r[:to1]
+ else
+ r[:flipped] = false
+ r[:fromhn], r[:tohn] = r[:from0], r[:to0]
end
[:from0, :to0, :from1, :to1].each {|k| r.delete k}
r

0 comments on commit a64b407

Please sign in to comment.