Skip to content

Commit

Permalink
refactor(block_manager): make map_logical_blocks const
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Nov 23, 2024
1 parent ab3e199 commit a83a32f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/dwarfs/writer/internal/block_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<chunk_type>& vec);
void map_logical_blocks(std::vector<chunk_type>& vec) const;
std::vector<fragment_category::value_type>
get_written_block_categories() const;

Expand Down
4 changes: 2 additions & 2 deletions src/writer/internal/block_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<chunk_type>& vec) {
void block_manager::map_logical_blocks(std::vector<chunk_type>& 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;
}
}

Expand Down

0 comments on commit a83a32f

Please sign in to comment.