From 0f4ba36008edaaaec34f98d13eb2f3d1a837a97d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 27 Sep 2022 09:47:59 +0200 Subject: [PATCH] FSEngine: Speed optimization Change-Id: I1fdb61042df47941921a8f278d0626b440084ec4 Reviewed-by: hjk --- src/libs/utils/fsengine/fsenginehandler.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/fsengine/fsenginehandler.cpp b/src/libs/utils/fsengine/fsenginehandler.cpp index a7f190e1e7b..f2b649c48da 100644 --- a/src/libs/utils/fsengine/fsenginehandler.cpp +++ b/src/libs/utils/fsengine/fsenginehandler.cpp @@ -48,16 +48,15 @@ QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const return new FixedListFSEngine(rootFilePath.pathAppended(scheme), filteredRoots); } } + + FilePath filePath = FilePath::fromString(fixedFileName); + if (filePath.needsDevice()) + return new FSEngineImpl(filePath); + + if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) + return new RootInjectFSEngine(fixedFileName); } - FilePath filePath = FilePath::fromString(fixedFileName); - if (filePath.needsDevice()) - return new FSEngineImpl(filePath); - - - if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) - return new RootInjectFSEngine(fixedFileName); - return nullptr; }