Skip to content

Commit 9a10207

Browse files
committed
Simplify code
1 parent 9a898ab commit 9a10207

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/osmium/builder/osm_object_builder.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,11 @@ namespace osmium {
349349

350350
// Get current comment pointer (recalculated each time to handle buffer reallocation)
351351
osmium::ChangesetComment* get_comment_ptr() {
352-
if (!has_open_comment()) {
353-
return nullptr;
352+
if (has_open_comment()) {
353+
return &buffer().get<osmium::ChangesetComment>(
354+
buffer().committed() + m_comment_offset);
354355
}
355-
return reinterpret_cast<osmium::ChangesetComment*>(
356-
buffer().data() + buffer().committed() + m_comment_offset
357-
);
356+
return nullptr;
358357
}
359358

360359
public:

0 commit comments

Comments
 (0)