File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ namespace osmium {
9090
9191 class Decompressor {
9292
93- std::atomic<std::size_t > m_file_size{0 };
9493 std::atomic<std::size_t > m_offset{0 };
9594
9695 std::atomic_bool m_want_buffered_pages_removed{false };
@@ -119,14 +118,6 @@ namespace osmium {
119118 return true ;
120119 }
121120
122- std::size_t file_size () const noexcept {
123- return m_file_size;
124- }
125-
126- void set_file_size (const std::size_t size) noexcept {
127- m_file_size = size;
128- }
129-
130121 std::size_t offset () const noexcept {
131122 return m_offset;
132123 }
@@ -222,9 +213,7 @@ namespace osmium {
222213
223214 std::unique_ptr<osmium::io::Decompressor> create_decompressor (const osmium::io::file_compression compression, const int fd) const {
224215 const auto callbacks = find_callbacks (compression);
225- auto p = std::unique_ptr<osmium::io::Decompressor>(std::get<1 >(callbacks)(fd));
226- p->set_file_size (osmium::file_size (fd));
227- return p;
216+ return std::unique_ptr<osmium::io::Decompressor>(std::get<1 >(callbacks)(fd));
228217 }
229218
230219 std::unique_ptr<osmium::io::Decompressor> create_decompressor (const osmium::io::file_compression compression, const char * buffer, const std::size_t size) const {
Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ namespace osmium {
322322 m_read_thread_manager(*m_decompressor, m_input_queue),
323323 m_osmdata_queue(detail::get_osmdata_queue_size(), "parser_results"),
324324 m_osmdata_queue_wrapper(m_osmdata_queue),
325- m_file_size(m_decompressor-> is_real () ? m_decompressor->file_size() : osmium::file_size(m_fd)) {
325+ m_file_size(m_fd > 2 ? osmium::file_size(m_fd) : 0 ) {
326326
327327 (void )std::initializer_list<int >{
328328 (set_option (args), 0 )...
You can’t perform that action at this time.
0 commit comments