From caa2f31d536f568e485f15537db5e2f79f7616d5 Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 22 Jan 2024 19:17:38 +0000 Subject: Miscellaneous bug fixes and format cleanup --- src/openvic-simulation/dataloader/Dataloader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp') diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index 6a2a3bb..cce766f 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -109,10 +109,7 @@ fs::path Dataloader::lookup_image_file(std::string_view path) const { return lookup_file(path); } -template -requires requires (_UniqueKey const& unique_key, std::string_view path) { - { unique_key(path) } -> std::convertible_to; -} +template Dataloader::path_vector_t Dataloader::_lookup_files_in_dir( std::string_view path, fs::path const& extension, _UniqueKey const& unique_key ) const { @@ -129,7 +126,7 @@ Dataloader::path_vector_t Dataloader::_lookup_files_in_dir( for (fs::directory_entry const& entry : _DirIterator { root / dirpath, ec }) { if (entry.is_regular_file()) { fs::path file = entry; - if ((extension.empty() || file.extension() == extension)) { + if (extension.empty() || file.extension() == extension) { const std::string full_path = file.string(); std::string_view relative_path = full_path; relative_path.remove_prefix(root_len); @@ -142,7 +139,7 @@ Dataloader::path_vector_t Dataloader::_lookup_files_in_dir( ret.emplace_back(std::move(file)); } else if (it->second.root == &root) { Logger::warning( - "Files in the same directory with conflicting keys: ", it->first, " - ", it->second.file, + "Files under the same root with conflicting keys: ", it->first, " - ", it->second.file, " (accepted) and ", key, " - ", file, " (rejected)" ); } -- cgit v1.2.3-56-ga3b1