Skip to content

Commit daae73d

Browse files
committed
Check OSMIUM_USE_POOL_THREADS_FOR_PBF_PARSING env var only once
per PBF input file
1 parent b263ba5 commit daae73d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/osmium/io/detail/pbf_input_format.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,13 @@ namespace osmium {
178178
}
179179

180180
void parse_data_blobs() {
181+
const bool use_pool = osmium::config::use_pool_threads_for_pbf_parsing();
181182
while (const auto size = check_type_and_get_blob_size("OSMData")) {
182183
std::string input_buffer{read_from_input_queue_with_check(size)};
183184

184185
PBFDataBlobDecoder data_blob_parser{std::move(input_buffer), read_types(), read_metadata()};
185186

186-
if (osmium::config::use_pool_threads_for_pbf_parsing()) {
187+
if (use_pool) {
187188
send_to_output_queue(get_pool().submit(std::move(data_blob_parser)));
188189
} else {
189190
send_to_output_queue(data_blob_parser());

0 commit comments

Comments
 (0)