summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-23 12:36:40 +0000
committerAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-23 12:36:40 +0000
commit89d856d03e5129e6c5b2a3e20f13dccb3e511531 (patch)
treeaeb23b6bce3e726f1ba3ef09ed9afbe50ada02d2
parentf307e7acc7c8b79a6e2f7d2baeab4771fa6d1887 (diff)
parentc2ac1ce046ff84df787f1584e8e6fff14c4359ac (diff)
Merge branch 'use_is_directory_member' into 'master'
Use is_directory member function See merge request OpenMW/openmw!3897
-rw-r--r--components/vfs/filesystemarchive.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/vfs/filesystemarchive.cpp b/components/vfs/filesystemarchive.cpp
index 01e5c2a1b5..3303c6656c 100644
--- a/components/vfs/filesystemarchive.cpp
+++ b/components/vfs/filesystemarchive.cpp
@@ -24,11 +24,11 @@ namespace VFS
for (auto it = std::filesystem::begin(iterator), end = std::filesystem::end(iterator); it != end;)
{
- const auto& i = *it;
+ const std::filesystem::directory_entry& entry = *it;
- if (!std::filesystem::is_directory(i))
+ if (!entry.is_directory())
{
- const std::filesystem::path& filePath = i.path();
+ const std::filesystem::path& filePath = entry.path();
const std::string proper = Files::pathToUnicodeString(filePath);
VFS::Path::Normalized searchable(std::string_view{ proper }.substr(prefix));
FileSystemArchiveFile file(filePath);
@@ -43,7 +43,7 @@ namespace VFS
// Exception thrown by the operator++ may not contain the context of the error like what exact path caused
// the problem which makes it hard to understand what's going on when iteration happens over a directory
// with thousands of files and subdirectories.
- const std::filesystem::path prevPath = i.path();
+ const std::filesystem::path prevPath = entry.path();
std::error_code ec;
it.increment(ec);
if (ec != std::error_code())