fix(rewrite_filesystem): only recompress blocks if actually requested

This commit is contained in:
Marcus Holland-Moritz 2024-11-25 17:59:09 +01:00
parent 48f423504c
commit 4538a8a3c8

View File

@ -122,9 +122,9 @@ void rewrite_filesystem(logger& lgr, dwarfs::reader::filesystem_v2 const& fs,
switch (s->type()) {
case section_type::BLOCK: {
std::optional<fragment_category::value_type> cat;
bool recompress_block{true};
bool recompress_block{opts.recompress_block};
if (opts.recompress_block) {
if (recompress_block) {
auto catstr = fs.get_block_category(block_no);
if (catstr) {