From cd79a1d92f1bea65ce7c66781069a35140f19524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 11 Sep 2021 15:44:40 +0200 Subject: [PATCH] Fix another GetFileInfo loop (GetFilesInDir now does return sizes) --- Common/File/DirListing.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Common/File/DirListing.cpp b/Common/File/DirListing.cpp index f41009f176..0d1d07ed7d 100644 --- a/Common/File/DirListing.cpp +++ b/Common/File/DirListing.cpp @@ -289,10 +289,7 @@ int64_t GetDirectoryRecursiveSize(const Path &path, const char *filter, int flag std::vector fileInfo; GetFilesInDir(path, &fileInfo, filter, flags); int64_t sizeSum = 0; - // Note: GetFilesInDir does not fill in fileSize. - for (size_t i = 0; i < fileInfo.size(); i++) { - FileInfo finfo; - GetFileInfo(fileInfo[i].fullName, &finfo); + for (const auto &finfo : fileInfo) { if (!finfo.isDirectory) sizeSum += finfo.size; else