VolumeDirectory: Use a range-based for loop in ComputeNameSize
This commit is contained in:
parent
f3987d13ea
commit
3196f697bb
|
@ -477,14 +477,11 @@ void CVolumeDirectory::WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u
|
||||||
static u32 ComputeNameSize(const File::FSTEntry& parentEntry)
|
static u32 ComputeNameSize(const File::FSTEntry& parentEntry)
|
||||||
{
|
{
|
||||||
u32 nameSize = 0;
|
u32 nameSize = 0;
|
||||||
const std::vector<File::FSTEntry>& children = parentEntry.children;
|
for (const File::FSTEntry& entry : parentEntry.children)
|
||||||
for (auto it = children.cbegin(); it != children.cend(); ++it)
|
|
||||||
{
|
{
|
||||||
const File::FSTEntry& entry = *it;
|
|
||||||
if (entry.isDirectory)
|
if (entry.isDirectory)
|
||||||
{
|
|
||||||
nameSize += ComputeNameSize(entry);
|
nameSize += ComputeNameSize(entry);
|
||||||
}
|
|
||||||
nameSize += (u32)entry.virtualName.length() + 1;
|
nameSize += (u32)entry.virtualName.length() + 1;
|
||||||
}
|
}
|
||||||
return nameSize;
|
return nameSize;
|
||||||
|
|
Loading…
Reference in New Issue