mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +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 <algorithm>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
#include <apps/launcher/utils/cellnameloader.hpp>
|
#include <apps/launcher/utils/cellnameloader.hpp>
|
||||||
|
|
||||||
@ -234,10 +235,12 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||||||
for (auto& currentDir : directories)
|
for (auto& currentDir : directories)
|
||||||
currentDir = QDir(QDir::cleanPath(currentDir)).canonicalPath();
|
currentDir = QDir(QDir::cleanPath(currentDir)).canonicalPath();
|
||||||
|
|
||||||
// add directories, archives and content files
|
std::unordered_set<QString> visitedDirectories;
|
||||||
directories.removeDuplicates();
|
for (const QString& currentDir : directories)
|
||||||
for (const auto& currentDir : directories)
|
|
||||||
{
|
{
|
||||||
|
if (!visitedDirectories.insert(currentDir).second)
|
||||||
|
continue;
|
||||||
|
|
||||||
// add new achives files presents in current directory
|
// add new achives files presents in current directory
|
||||||
addArchivesFromDir(currentDir);
|
addArchivesFromDir(currentDir);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user