diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-06-05 17:56:05 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-06-07 19:34:39 +0200 |
commit | b919f2c84f56dd3a26ef08ca308b80cdbe3729ff (patch) | |
tree | ba7177e7702ab9f0c72cd198c2a36f4dac99e216 | |
parent | 5142b99f94dcbf47274a5f32a1780cf865621401 (diff) | |
download | justbuild-b919f2c84f56dd3a26ef08ca308b80cdbe3729ff.tar.gz |
file_system: Drop unused template argument
... which became obsolete with the new fdless write/copy
implementations.
-rw-r--r-- | src/buildtool/file_system/file_system_manager.hpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp index d0c70ff2..674d87f4 100644 --- a/src/buildtool/file_system/file_system_manager.hpp +++ b/src/buildtool/file_system/file_system_manager.hpp @@ -748,7 +748,6 @@ class FileSystemManager { } } - template <bool kLogError = true> [[nodiscard]] static auto CopyFileImpl( std::filesystem::path const& src, std::filesystem::path const& dst, @@ -758,40 +757,31 @@ class FileSystemManager { try { return std::filesystem::copy_file(src, dst, opt); } catch (std::exception const& e) { - if constexpr (kLogError) { - Logger::Log(LogLevel::Error, - "copying file from {} to {}:\n{}", - src.string(), - dst.string(), - e.what()); - } + Logger::Log(LogLevel::Error, + "copying file from {} to {}:\n{}", + src.string(), + dst.string(), + e.what()); return false; } } - template <bool kLogError = true> [[nodiscard]] static auto WriteFileImpl( std::string const& content, std::filesystem::path const& file) noexcept -> bool { try { std::ofstream writer{file}; if (!writer.is_open()) { - if constexpr (kLogError) { - Logger::Log( - LogLevel::Error, "can not open file {}", file.string()); - } + Logger::Log( + LogLevel::Error, "can not open file {}", file.string()); return false; } writer << content; writer.close(); return true; } catch (std::exception const& e) { - if constexpr (kLogError) { - Logger::Log(LogLevel::Error, - "writing to {}:\n{}", - file.string(), - e.what()); - } + Logger::Log( + LogLevel::Error, "writing to {}:\n{}", file.string(), e.what()); return false; } } |