mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 20:45:34 +00:00
Use set to track visited directories instead of removing duplicates
This commit is contained in:
parent
da5376ff3a
commit
9f00b99b22
1 changed files with 6 additions and 3 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <apps/launcher/utils/cellnameloader.hpp>
|
||||
|
||||
|
@ -239,10 +240,12 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||
for (auto& currentDir : directories)
|
||||
currentDir = QDir(QDir::cleanPath(currentDir)).canonicalPath();
|
||||
|
||||
// add directories, archives and content files
|
||||
directories.removeDuplicates();
|
||||
for (const auto& currentDir : directories)
|
||||
std::unordered_set<QString> visitedDirectories;
|
||||
for (const QString& currentDir : directories)
|
||||
{
|
||||
if (!visitedDirectories.insert(currentDir).second)
|
||||
continue;
|
||||
|
||||
// add new achives files presents in current directory
|
||||
addArchivesFromDir(currentDir);
|
||||
|
||||
|
|
Loading…
Reference in a new issue