diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-19 05:03:22 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-19 05:03:27 +0200 |
commit | 5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed (patch) | |
tree | d2fa27f1b3e752bf628f9584db16f5b603c6a3e6 /src/core/file_sys/vfs.cpp | |
parent | Merge pull request #691 from lioncash/guard (diff) | |
download | yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar.gz yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar.bz2 yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar.lz yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar.xz yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.tar.zst yuzu-5e626c774fa28cf8689f4f3e52d2c4c5ba8c64ed.zip |
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
-rw-r--r-- | src/core/file_sys/vfs.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index f859ef33f..16c8ad90b 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp @@ -116,14 +116,14 @@ bool VfsDirectory::IsRoot() const { size_t VfsDirectory::GetSize() const { const auto& files = GetFiles(); - const auto file_total = - std::accumulate(files.begin(), files.end(), 0ull, - [](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); }); + const auto sum_sizes = [](const auto& range) { + return std::accumulate(range.begin(), range.end(), 0ULL, + [](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); }); + }; + const auto file_total = sum_sizes(files); const auto& sub_dir = GetSubdirectories(); - const auto subdir_total = - std::accumulate(sub_dir.begin(), sub_dir.end(), 0ull, - [](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); }); + const auto subdir_total = sum_sizes(sub_dir); return file_total + subdir_total; } |