summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-26 12:06:40 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-27 05:06:51 +0000
commit97b448b152f0148adb2426c2a4e1f83dd150db3c (patch)
treeb2e5b2676683cab3f456cd8e1ffc7e56c4a814c7 /src/corelib
parentc195fde37a533956073000590b3bf66cb91e6bc3 (diff)
Use QFile::exists(f) instead of QFile(f).exists().
It's faster. Change-Id: Ie57619b4e0c53975aa955c83c833c34e1446e4c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index ce1684a943..4474fd3f52 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -747,7 +747,7 @@ QFile::copy(const QString &newName)
qWarning("QFile::copy: Empty or null file name");
return false;
}
- if (QFile(newName).exists()) {
+ if (QFile::exists(newName)) {
// ### Race condition. If a file is moved in after this, it /will/ be
// overwritten. On Unix, the proper solution is to use hardlinks:
// return ::link(old, new) && ::remove(old); See also rename().