From b38a26c2bc731ad123365e7f164d1a9ed0c89b6a Mon Sep 17 00:00:00 2001 From: Al Date: Tue, 12 Feb 2019 23:56:09 +0100 Subject: Performance improvements: * Avoid accessing disk for finding archives if archive parsing is disabled. * Avoid very expensive createFile() call in removeOrigin(), after disabling a mod or closing modinfodialog. --- src/shared/directoryentry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/shared/directoryentry.cpp') diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 9f54e526..8fc63188 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -313,18 +313,18 @@ bool FileEntry::removeOrigin(int origin) m_Origin = currentID; // now we need to update the file time... - std::wstring filePath = getFullPath(); - HANDLE file = ::CreateFile(filePath.c_str(), GENERIC_READ | GENERIC_WRITE, - 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); - if (!::GetFileTime(file, nullptr, nullptr, &m_FileTime)) { + //std::wstring filePath = getFullPath(); + //HANDLE file = ::CreateFile(filePath.c_str(), GENERIC_READ | GENERIC_WRITE, + // 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); + //if (!::GetFileTime(file, nullptr, nullptr, &m_FileTime)) { // maybe this file is in a bsa, but there is no easy way to find out which. User should refresh // the view to find out //m_Archive = std::pair(L"bsa?", -1); - } else { + //} else { //m_Archive = std::pair(L"", -1); - } + //} - ::CloseHandle(file); + //::CloseHandle(file); } else { m_Origin = -1; -- cgit v1.3.1