Skip to content

Commit 33dab8e

Browse files
committed
Negative ids are not allowed any more so we don't need some checks
1 parent c7ab81c commit 33dab8e

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

src/node-persistent-cache.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@
66

77
void node_persistent_cache::set(osmid_t id, osmium::Location location)
88
{
9-
if (id < 0) {
10-
throw std::runtime_error{"Flatnode store cannot save negative IDs."};
11-
}
129
m_index->set(static_cast<osmium::unsigned_object_id_type>(id), location);
1310
}
1411

1512
osmium::Location node_persistent_cache::get(osmid_t id) const noexcept
1613
{
17-
if (id < 0) {
18-
return osmium::Location{};
19-
}
20-
2114
return m_index->get_noexcept(
2215
static_cast<osmium::unsigned_object_id_type>(id));
2316
}

src/node-persistent-cache.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class node_persistent_cache
2323
std::size_t get_list(osmium::WayNodeList *nodes) const;
2424

2525
private:
26-
// Dense node cache for unsigned IDs only
2726
using index_t =
2827
osmium::index::map::DenseFileArray<osmium::unsigned_object_id_type,
2928
osmium::Location>;

0 commit comments

Comments
 (0)