Skip to content

Commit

Permalink
QTemporaryFileEngine: minor optimization
Browse files Browse the repository at this point in the history
The original code updated d->fileEntry twice in a row: it assigned to it
directly, then called QFSFileEngine::setFileName() which assigned to
d->fileEntry again. Now only one QFileSystemEntry is constructed.

Change-Id: I3cdc131b97455c14e5b032fbdecdae0eaa32925f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
Ahmad Samir committed Apr 20, 2024
1 parent df6b74f commit 8d549c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/corelib/io/qtemporaryfile_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ class QTemporaryFileEngine : public QFSFileEngine
if (filePathIsTemplate) {
d->fileEntry.clear();
} else {
d->fileEntry = QFileSystemEntry(file);
QFSFileEngine::setFileName(file);
QFSFileEngine::setFileEntry(QFileSystemEntry(file));
}
}
~QTemporaryFileEngine();
Expand Down

0 comments on commit 8d549c3

Please sign in to comment.