X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/15b104f4ff4614aa78c01180b6a9b89dd5a1400f..11806a676fb88f51ece004b7c05bde38f1e77706:/lib/diff_reader.rb?ds=sidebyside 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 ##