aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-01-22 20:17:38 +0100
committer hop311 <hop3114@gmail.com>2024-01-22 20:25:09 +0100
commitcaa2f31d536f568e485f15537db5e2f79f7616d5 (patch)
tree7cd8a379963af18c24f8dabfe7525b39f2333e0c /src/openvic-simulation/dataloader/Dataloader.cpp
parent8205732a1b95f018f0898a2a4bc62e22f5bee0d3 (diff)
Miscellaneous bug fixes and format cleanupmisc-changes
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp9
1 files changed, 3 insertions, 6 deletions
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<typename _DirIterator, typename _UniqueKey>
-requires requires (_UniqueKey const& unique_key, std::string_view path) {
- { unique_key(path) } -> std::convertible_to<std::string_view>;
-}
+template<typename _DirIterator, UniqueFileKey _UniqueKey>
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)"
);
}