From 3196f697bb18c4b21d4df247d00621f3ae8eff9a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 25 Dec 2016 23:01:42 +0100 Subject: [PATCH] VolumeDirectory: Use a range-based for loop in ComputeNameSize --- Source/Core/DiscIO/VolumeDirectory.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index 872ef94a0b..f114b95c9d 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -477,14 +477,11 @@ void CVolumeDirectory::WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u static u32 ComputeNameSize(const File::FSTEntry& parentEntry) { u32 nameSize = 0; - const std::vector& children = parentEntry.children; - for (auto it = children.cbegin(); it != children.cend(); ++it) + for (const File::FSTEntry& entry : parentEntry.children) { - const File::FSTEntry& entry = *it; if (entry.isDirectory) - { nameSize += ComputeNameSize(entry); - } + nameSize += (u32)entry.virtualName.length() + 1; } return nameSize;