OSDN Git Service

avoid temporary in QFileSystemEngine::setCurrentPath()
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 18 Dec 2019 22:50:13 +0000 (22:50 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 18 Dec 2019 22:50:13 +0000 (22:50 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/io/qfilesystemengine_unix.cpp

index c3c36a5..14e5150 100644 (file)
@@ -511,10 +511,8 @@ QString QFileSystemEngine::tempPath()
 
 bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &path)
 {
-    int r;
     const char* cPath = path.nativeFilePath().constData();
-    r = QT_CHDIR(cPath);
-    return r >= 0;
+    return (QT_CHDIR(cPath) >= 0);
 }
 
 QFileSystemEntry QFileSystemEngine::currentPath()