From 4229de1685dd0a671f332faf7bfed3ffe5cd8a87 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Tue, 7 Dec 2021 19:00:05 +0200 Subject: [PATCH] Remove redundant QDir::fromNativeSeparators() call QFileSystemEntry::QFileSystemEntry(const QString &filePath) already calls this function. Calling it repeatedly changes nothing but wastes CPU time. Neither the line modified in this commit nor the QFileSystemEntry's constructor have been changed since 2011's commit "Initial import from the monolithic Qt." Other constructor overloads of QFileInfoPrivate don't call QDir::fromNativeSeparators(). Change-Id: I01e54662efd96e87c4a686369dc0b265b47e5938 Reviewed-by: Thiago Macieira --- src/corelib/io/qfileinfo_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 333ea70adc..8b02c8ab8b 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -101,7 +101,7 @@ public: cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0) {} inline QFileInfoPrivate(const QString &file) - : fileEntry(QDir::fromNativeSeparators(file)), + : fileEntry(file), fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)), cachedFlags(0), #ifndef QT_NO_FSFILEENGINE