From 98ae0d44e63d973823eb7c6991e3f10364f40ed5 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 23 Jul 2021 09:46:58 +0200 Subject: [PATCH] Utils: Reduce need for resolving of symlinks Be more strict when checking whether two files might be the same executable. As side-effect this reduces the calls to symLinkTarget() a lot and speeds up auto detection of kits. Change-Id: I23dc697a34bf93f8bd09cbe7e9d17f829cf0d010 Reviewed-by: hjk --- src/libs/utils/environment.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 87c17b6b560..908132fae84 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -183,6 +183,8 @@ bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) con const FilePath f2 = FilePath::fromString(i2); if (f1 == f2) return true; + if (f1.needsDevice() != f2.needsDevice() || f1.scheme() != f2.scheme()) + return false; if (f1.resolveSymlinks() == f2.resolveSymlinks()) return true; if (FileUtils::fileId(f1) == FileUtils::fileId(f2))