summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdir.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-08-11 14:17:40 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-08-26 12:07:36 (GMT)
commit664abe11efdbf582a5433abccf0d8c6fdbe2b040 (patch)
treeede8c86e75272b1b9197a91b13a26cccf654e8e6 /src/corelib/io/qdir.cpp
parentdcee6e1371d899eb79717b8e3f3eec08b765db82 (diff)
downloadQt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.zip
Qt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.tar.gz
Qt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.tar.bz2
Compare non-canonical paths before falling back on expensive computation
Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/corelib/io/qdir.cpp')
-rw-r--r--src/corelib/io/qdir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 6e25d91..c0c62e1 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1634,6 +1634,10 @@ bool QDir::operator==(const QDir &dir) const
&& d->sort == other->sort
&& d->nameFilters == other->nameFilters) {
+ // Assume directories are the same if path is the same
+ if (d->dirEntry.filePath() == other->dirEntry.filePath())
+ return true;
+
// Fallback to expensive canonical path computation
return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0;
}