Merge branch 'master' into openstreetbugs
[rails.git] / lib / osm.rb
index e2fffd17fe59492c08e6c2b4ea7b8a776738eb9e..c34c928ffb350abdda8f340a124ff051d1b0c143 100644 (file)
@@ -471,9 +471,7 @@ module OSM
   def self.IPLocation(ip_address)
     code = OSM.IPToCountry(ip_address)
 
-    unless code.nil?
-      country = Country.find_by_code(code)
-
+    if code and country = Country.find_by_code(code)
       return { :minlon => country.min_lon, :minlat => country.min_lat, :maxlon => country.max_lon, :maxlat => country.max_lat }
     end