mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Use set to track visited directories instead of removing duplicates
This commit is contained in:
parent
b55313c08e
commit
ff7fcd752a
@ -9,6 +9,7 @@
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <apps/launcher/utils/cellnameloader.hpp>
|
||||
|
||||
@ -234,10 +235,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…
x
Reference in New Issue
Block a user