]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/files/default/ruby/expire.rb
Fix rubocop warnings
[chef.git] / cookbooks / tile / files / default / ruby / expire.rb
index 8a212aa92f3904dc79d738c617a351aeacaf50b9..3d693ad5b225d3fa9d1a525cd329e97672de0f46 100755 (executable)
@@ -103,12 +103,8 @@ module Expire
     # added, deleted or modified - the tile will need updating anyway.
     doc.find("//node").each do |node|
       lat = node["lat"].to_f
-      if lat < -85
-        lat = -85
-      end
-      if lat > 85
-        lat = 85
-      end
+      lat = -85 if lat < -85
+      lat = 85 if lat > 85
       point = Proj4::Point.new(Math::PI * node["lon"].to_f / 180,
                                Math::PI * lat / 180)
       nodes[node["id"].to_i] = tile_from_latlon(point, max_zoom)
@@ -186,9 +182,7 @@ module Expire
 
         lon, lat = @cache.sysread(8).unpack("ll")
 
-        if lon != -2147483648 && lat != -2147483648
-          node = Node.new(lon, lat)
-        end
+        node = Node.new(lon, lat) if lon != -2147483648 && lat != -2147483648
       end
 
       node