Skip to content

Commit

Permalink
only check current directory for duplicate directory instead of all i…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
G4Vi authored and CookiePLMonster committed Feb 14, 2022
1 parent e4a5c82 commit 9b84455
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/mkpsxiso/iso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,14 @@ iso::DirTreeClass* iso::DirTreeClass::AddSubDirEntry(const char* id, const std::
// a new directory to 'entries'.
// TODO: It's not possible now, but a warning should be issued if entry attributes are specified for the subsequent occurences
// of the directory. This check probably needs to be moved outside of the function.
auto currentSubdir = std::find_if(entries.begin(), entries.end(), [id](const auto& e)
{
return e.type == EntryType::EntryDir && e.id == id;
});

if (currentSubdir != entries.end())
for(auto& e : entriesInDir)
{
alreadyExists = true;
return currentSubdir->subdir.get();
const iso::DIRENTRY& entry = e.get();
if((entry.type == EntryType::EntryDir) && (entry.id == id))
{
alreadyExists = true;
return entry.subdir.get();
}
}

auto fileAttrib = Stat(srcDir);
Expand Down

0 comments on commit 9b84455

Please sign in to comment.