From fb3fbd34211a28b27214abe070c46951057258ca Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 14 Feb 2020 03:19:21 -0500 Subject: removed lastAccessed from FileEntry, not used FileRegister keeps a vector instead of a map --- src/directoryrefresher.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/directoryrefresher.cpp') diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index cb5bfc5b..f3285cfc 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -39,7 +39,7 @@ using namespace MOShared; DirectoryRefresher::DirectoryRefresher(std::size_t threadCount) - : m_DirectoryStructure(nullptr), m_threadCount(threadCount) + : m_DirectoryStructure(nullptr), m_threadCount(threadCount), m_lastFileCount(0) { } @@ -283,7 +283,9 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( const auto& e = entries[i]; const int prio = static_cast(i + 1); - stats[i].mod = entries[i].modName.toStdString(); + if constexpr (DirectoryStats::EnableInstrumentation) { + stats[i].mod = entries[i].modName.toStdString(); + } try { @@ -312,7 +314,9 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( g_threads.waitForAll(); - dumpStats(stats); + if constexpr (DirectoryStats::EnableInstrumentation) { + dumpStats(stats); + } } void DirectoryRefresher::refresh() @@ -325,6 +329,7 @@ void DirectoryRefresher::refresh() delete m_DirectoryStructure; m_DirectoryStructure = new DirectoryEntry(L"data", nullptr, 0); + m_DirectoryStructure->getFileRegister()->reserve(m_lastFileCount); IPluginGame *game = qApp->property("managed_game").value(); @@ -347,6 +352,8 @@ void DirectoryRefresher::refresh() cleanStructure(m_DirectoryStructure); } + m_lastFileCount = m_DirectoryStructure->getFileRegister()->highestCount(); + emit progress(100); emit refreshed(); } -- cgit v1.3.1