diff --git a/support/src/utils/encrypting_reader.cpp b/support/src/utils/encrypting_reader.cpp index 1d371add..16cb4974 100644 --- a/support/src/utils/encrypting_reader.cpp +++ b/support/src/utils/encrypting_reader.cpp @@ -206,8 +206,7 @@ encrypting_reader::encrypting_reader( throw std::runtime_error("failed to get file size|" + source_file_->get_path()); } - - auto file_size{opt_size.value()}; + auto file_size = opt_size.value(); const auto total_chunks = utils::divide_with_ceiling( file_size, static_cast(data_chunk_size_)); @@ -246,8 +245,7 @@ encrypting_reader::encrypting_reader(std::string_view encrypted_file_path, throw std::runtime_error("failed to get file size|" + source_file_->get_path()); } - - auto file_size{opt_size.value()}; + auto file_size = opt_size.value(); const auto total_chunks = utils::divide_with_ceiling( file_size, static_cast(data_chunk_size_)); @@ -289,7 +287,6 @@ encrypting_reader::encrypting_reader( source_file_->get_path() + '|' + std::to_string(utils::get_last_error_code())); } - auto file_size{opt_size.value()}; const auto total_chunks = utils::divide_with_ceiling( @@ -339,7 +336,6 @@ auto encrypting_reader::calculate_encrypted_size(std::string_view source_path) std::string{source_path} + '|' + std::to_string(utils::get_last_error_code())); } - auto file_size{opt_size.value()}; const auto total_chunks = utils::divide_with_ceiling( diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index 4030a6c0..85f959b3 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -25,6 +25,7 @@ #include "utils/error.hpp" #include "utils/path.hpp" #include "utils/string.hpp" +#include "utils/time.hpp" namespace repertory::utils::file { auto i_file::read_all(data_buffer &data, std::uint64_t offset,