aboutsummaryrefslogtreecommitdiff
path: root/src/common/fs
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-06-16 15:12:46 -0400
committerLiam <byteslice@airmail.cc>2023-06-16 16:29:06 -0400
commit0f7b1f067f9d143aa72b26bff171e2bc66a6250e (patch)
treeede803c6cfca7ccc0bc258e3b784766a676ff61d /src/common/fs
parentdf44a077c894af01cadf8e171495660d346fe249 (diff)
vfs_real: misc optimizations
Diffstat (limited to 'src/common/fs')
-rw-r--r--src/common/fs/fs.cpp8
-rw-r--r--src/common/fs/fs_types.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/common/fs/fs.cpp b/src/common/fs/fs.cpp
index 6d66c926dc..1baf6d7464 100644
--- a/src/common/fs/fs.cpp
+++ b/src/common/fs/fs.cpp
@@ -436,7 +436,7 @@ void IterateDirEntries(const std::filesystem::path& path, const DirEntryCallable
if (True(filter & DirEntryFilter::File) &&
entry.status().type() == fs::file_type::regular) {
- if (!callback(entry.path())) {
+ if (!callback(entry)) {
callback_error = true;
break;
}
@@ -444,7 +444,7 @@ void IterateDirEntries(const std::filesystem::path& path, const DirEntryCallable
if (True(filter & DirEntryFilter::Directory) &&
entry.status().type() == fs::file_type::directory) {
- if (!callback(entry.path())) {
+ if (!callback(entry)) {
callback_error = true;
break;
}
@@ -493,7 +493,7 @@ void IterateDirEntriesRecursively(const std::filesystem::path& path,
if (True(filter & DirEntryFilter::File) &&
entry.status().type() == fs::file_type::regular) {
- if (!callback(entry.path())) {
+ if (!callback(entry)) {
callback_error = true;
break;
}
@@ -501,7 +501,7 @@ void IterateDirEntriesRecursively(const std::filesystem::path& path,
if (True(filter & DirEntryFilter::Directory) &&
entry.status().type() == fs::file_type::directory) {
- if (!callback(entry.path())) {
+ if (!callback(entry)) {
callback_error = true;
break;
}
diff --git a/src/common/fs/fs_types.h b/src/common/fs/fs_types.h
index 5a4090c190..900f85d24e 100644
--- a/src/common/fs/fs_types.h
+++ b/src/common/fs/fs_types.h
@@ -66,6 +66,6 @@ DECLARE_ENUM_FLAG_OPERATORS(DirEntryFilter);
* @returns A boolean value.
* Return true to indicate whether the callback is successful, false otherwise.
*/
-using DirEntryCallable = std::function<bool(const std::filesystem::path& path)>;
+using DirEntryCallable = std::function<bool(const std::filesystem::directory_entry& entry)>;
} // namespace Common::FS