Skip to content

Commit ac60afc

Browse files
committed
Using 64bit unsigned int for comparison
1 parent da33166 commit ac60afc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/osmium/index/relations_map.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ namespace osmium {
356356
*/
357357
void add(const osmium::unsigned_object_id_type member_id, const osmium::unsigned_object_id_type relation_id) {
358358
assert(m_valid && "You can't use the RelationsMap any more after calling build_index()");
359-
if (member_id <= std::numeric_limits<uint32_t>::max() && relation_id <= std::numeric_limits<uint32_t>::max()) {
359+
constexpr const osmium::unsigned_object_id_type max32 = std::numeric_limits<uint32_t>::max();
360+
if (member_id <= max32 && relation_id <= max32) {
360361
m_map32.set(member_id, relation_id);
361362
} else {
362363
m_map64.set(member_id, relation_id);

0 commit comments

Comments
 (0)