Skip to content

Commit c047f96

Browse files
committed
Revert "Order deleted objects after visible ones in reverse id order"
This reverts commit cff8ff4. Turns out this creates some problems. See #403
1 parent 54b0bc1 commit c047f96

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

include/osmium/osm/object_comparisons.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,9 @@ namespace osmium {
160160

161161
bool operator()(const osmium::OSMObject& lhs, const osmium::OSMObject& rhs) const noexcept {
162162
return const_tie(lhs.type(), lhs.id() > 0, lhs.positive_id(), rhs.version(),
163-
((lhs.timestamp().valid() && rhs.timestamp().valid()) ? rhs.timestamp() : osmium::Timestamp()),
164-
rhs.visible()) <
163+
((lhs.timestamp().valid() && rhs.timestamp().valid()) ? rhs.timestamp() : osmium::Timestamp())) <
165164
const_tie(rhs.type(), rhs.id() > 0, rhs.positive_id(), lhs.version(),
166-
((lhs.timestamp().valid() && rhs.timestamp().valid()) ? lhs.timestamp() : osmium::Timestamp()),
167-
lhs.visible());
165+
((lhs.timestamp().valid() && rhs.timestamp().valid()) ? lhs.timestamp() : osmium::Timestamp()));
168166
}
169167

170168
/// @pre lhs and rhs must not be nullptr

test/t/osm/test_object_comparisons.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,6 @@ TEST_CASE("Node comparisons") {
195195
REQUIRE(std::is_sorted(nodes.cbegin(), nodes.cend(), osmium::object_order_type_id_reverse_version{}));
196196
}
197197

198-
SECTION("reverse version ordering should order objects with deleted flag last") {
199-
nodes.emplace_back(buffer.get<osmium::Node>(osmium::builder::add_node(buffer, _id( 1), _version(2), _timestamp("2016-01-01T00:00:00Z"), _deleted(false))));
200-
nodes.emplace_back(buffer.get<osmium::Node>(osmium::builder::add_node(buffer, _id( 1), _version(2), _timestamp("2016-01-01T00:00:00Z"), _deleted(true))));
201-
202-
REQUIRE(std::is_sorted(nodes.cbegin(), nodes.cend(), osmium::object_order_type_id_reverse_version{}));
203-
}
204198
}
205199

206200
TEST_CASE("Object comparisons: types are ordered nodes, then ways, then relations") {

0 commit comments

Comments
 (0)