зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1875036 - Speed up directory enumeration on Windows. r=win-reviewers,gstoll
We replace the use of FindFirstFileW by FindFirstFileExW with the most optimized combination of flags on the code path reached from nsIDirectoryEnumerator on Windows. This should make enumeration faster, in particular when enumerating directories with thousands of files like it can happen in QuotaManager code. Differential Revision: https://phabricator.services.mozilla.com/D207151
This commit is contained in:
Родитель
7c5cdb53a9
Коммит
484214561b
|
@ -673,10 +673,12 @@ static nsresult OpenDir(const nsString& aName, nsDir** aDir) {
|
|||
|
||||
filename.ReplaceChar(L'/', L'\\');
|
||||
|
||||
// FindFirstFileW Will have a last error of ERROR_DIRECTORY if
|
||||
// FindFirstFileExW Will have a last error of ERROR_DIRECTORY if
|
||||
// <file_path>\* is passed in. If <unknown_path>\* is passed in then
|
||||
// ERROR_PATH_NOT_FOUND will be the last error.
|
||||
d->handle = ::FindFirstFileW(filename.get(), &(d->data));
|
||||
d->handle = ::FindFirstFileExW(filename.get(), FindExInfoBasic, &(d->data),
|
||||
FindExSearchNameMatch, nullptr,
|
||||
FIND_FIRST_EX_LARGE_FETCH);
|
||||
|
||||
if (d->handle == INVALID_HANDLE_VALUE) {
|
||||
delete d;
|
||||
|
|
Загрузка…
Ссылка в новой задаче