X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..fe6f3598f0884e7d52120a41529ec8011e1bfe88:/lib/diff_reader.rb diff --git a/lib/diff_reader.rb b/lib/diff_reader.rb index 94c41a6d5..e3c533b7a 100644 --- a/lib/diff_reader.rb +++ b/lib/diff_reader.rb @@ -8,8 +8,8 @@ class DiffReader # maps each element type to the model class which handles it MODELS = { - "node" => Node, - "way" => Way, + "node" => Node, + "way" => Way, "relation" => Relation }.freeze @@ -60,9 +60,7 @@ class DiffReader attributes = {} if @reader.has_attributes? - while @reader.move_to_next_attribute == 1 - attributes[@reader.name] = @reader.value - end + attributes[@reader.name] = @reader.value while @reader.move_to_next_attribute == 1 @reader.move_to_element end @@ -112,9 +110,7 @@ class DiffReader # such as save_ and delete_with_history. def check(model, xml, new) raise OSM::APIBadXMLError.new(model, xml) if new.nil? - unless new.changeset_id == @changeset.id - raise OSM::APIChangesetMismatchError.new(new.changeset_id, @changeset.id) - end + raise OSM::APIChangesetMismatchError.new(new.changeset_id, @changeset.id) unless new.changeset_id == @changeset.id end ##