diff --git a/src/compress.cc b/src/compress.cc index b5406fb..2966ac0 100644 --- a/src/compress.cc +++ b/src/compress.cc @@ -3,19 +3,20 @@ * \brief Implementation of compression */ +#include "compress.hh" +#include "utf8.hh" +#include +#include +#include +#include +#include + #ifdef Debug constexpr bool debug_mode = true; #else constexpr bool debug_mode = false; #endif -#include "compress.hh" -#include "utf8.hh" -#include -#include -#include -#include - using dict_t = std::map, uint32_t>; using ustring = std::basic_string; // chaîne non encodée using uvec = std::vector; // chaîne encodée @@ -106,10 +107,10 @@ void compress(const std::string &t_in_file, const char *t_out_file) { std::vector chunk(32768, 0); while (input_file.read(chunk.data(), static_cast(chunk.size()))) { - printf("\n"); threads.emplace_back(nullptr, uvec{}); threads.back().first = std::make_unique( std::thread{lzw_compress, chunk, ref(threads.back().second)}); + assert(threads.back().first); if (threads.size() >= 8) { join_and_write(threads, out); }