diff --git a/include/dwarfs/writer/internal/block_manager.h b/include/dwarfs/writer/internal/block_manager.h index d6a62d6ab..e37fa94f0 100644 --- a/include/dwarfs/writer/internal/block_manager.h +++ b/include/dwarfs/writer/internal/block_manager.h @@ -37,7 +37,7 @@ class block_manager { size_t get_logical_block() const; void set_written_block(size_t logical_block, size_t written_block, fragment_category::value_type category); - void map_logical_blocks(std::vector& vec); + void map_logical_blocks(std::vector& vec) const; std::vector get_written_block_categories() const; diff --git a/src/writer/internal/block_manager.cpp b/src/writer/internal/block_manager.cpp index 3e48d3200..c275709e3 100644 --- a/src/writer/internal/block_manager.cpp +++ b/src/writer/internal/block_manager.cpp @@ -45,12 +45,12 @@ void block_manager::set_written_block(size_t logical_block, block_map_[logical_block] = std::make_pair(written_block, category); } -void block_manager::map_logical_blocks(std::vector& vec) { +void block_manager::map_logical_blocks(std::vector& vec) const { std::lock_guard lock{mx_}; for (auto& c : vec) { size_t block = c.get_block(); assert(block < num_blocks_); - c.block() = block_map_[block].value().first; + c.block() = block_map_.at(block).value().first; } }