diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2011-08-11 14:17:40 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2011-08-26 12:07:36 (GMT) |
commit | 664abe11efdbf582a5433abccf0d8c6fdbe2b040 (patch) | |
tree | ede8c86e75272b1b9197a91b13a26cccf654e8e6 /src/corelib/io/qdir.cpp | |
parent | dcee6e1371d899eb79717b8e3f3eec08b765db82 (diff) | |
download | Qt-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.cpp | 4 |
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; } |