Skip to content

Commit

Permalink
extract_manager: only initialize extractor when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed Jul 22, 2023
1 parent 28581fc commit 97ad3a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/extract/extract_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,6 @@ sqsh__extract_manager_uncompress(
manager->compression_id;
const uint32_t block_size = manager->block_size;

rv = sqsh__extractor_init(&extractor, compression_id, block_size);
if (rv < 0) {
goto out;
}

rv = sqsh_mutex_lock(&manager->lock);
if (rv < 0) {
goto out;
Expand All @@ -160,6 +155,11 @@ sqsh__extract_manager_uncompress(
}
const uint8_t *data = sqsh__map_reader_data(reader);

rv = sqsh__extractor_init(&extractor, compression_id, block_size);
if (rv < 0) {
goto out;
}

rv = sqsh__extractor_to_buffer(&extractor, &buffer, data, size);
if (rv < 0) {
sqsh__buffer_cleanup(&buffer);
Expand Down

0 comments on commit 97ad3a0

Please sign in to comment.