From fc3c6cde83ef705565cc8f3b960cc838329049d6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 28 Oct 2019 11:14:11 +0100 Subject: qmake: Don't call QDir::count() over and over This can be expensive. We don't expect files to be added to the directory while qmake is running, and if that happened, the result would be unpredictable anyway. Change-Id: I5db93132046c1284130bbe51ce1ecd2a14665206 Reviewed-by: Thiago Macieira --- qmake/library/qmakebuiltins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/library') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 866915bdfd..7f6926e98e 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1043,7 +1043,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( for (int d = 0; d < dirs.count(); d++) { QString dir = dirs[d]; QDir qdir(pfx + dir); - for (int i = 0; i < (int)qdir.count(); ++i) { + for (int i = 0, count = int(qdir.count()); i < count; ++i) { if (qdir[i] == statics.strDot || qdir[i] == statics.strDotDot) continue; QString fname = dir + qdir[i]; -- cgit v1.2.3