diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-09-14 17:01:50 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-09-15 13:01:20 (GMT) |
commit | 3289a268d58181b22f7fe90669a7215bc2edc75a (patch) | |
tree | d2d7b49c9ab9f0ba75ff26544c5788623dcfda55 | |
parent | 108eb5b7d21e24e48f214ea8f171fa97c0087167 (diff) | |
download | Qt-3289a268d58181b22f7fe90669a7215bc2edc75a.zip Qt-3289a268d58181b22f7fe90669a7215bc2edc75a.tar.gz Qt-3289a268d58181b22f7fe90669a7215bc2edc75a.tar.bz2 |
Don't compute canonical paths when not needed
This optimisation saves 20% on symbian recursive iteration,
and should help on other OS when the FollowSymlinks flag is not
specified for directory iteration.
Reviewed-By: joao
-rw-r--r-- | src/corelib/io/qdiriterator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 2e67bfd..582fb85 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -299,7 +299,8 @@ void QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo) return; // Stop link loops - if (visitedLinks.contains(fileInfo.canonicalFilePath())) + if (!visitedLinks.isEmpty() && + visitedLinks.contains(fileInfo.canonicalFilePath())) return; pushDirectory(fileInfo); |