forked from qt-creator/qt-creator
Utils: Don't call mutable expressions inside QTC_ASSERT
In order to conform to the theory: "Removing all QTC_ASSERTs and QTC_CHECKs should not change anything". Change-Id: I6f5c4486afb422301562d79c662fdde026e4d788 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -560,7 +560,8 @@ bool DesktopDeviceFileAccess::writeFileContents(
|
||||
qint64 offset) const
|
||||
{
|
||||
QFile file(filePath.path());
|
||||
QTC_ASSERT(file.open(QFile::WriteOnly | QFile::Truncate), return false);
|
||||
const bool isOpened = file.open(QFile::WriteOnly | QFile::Truncate);
|
||||
QTC_ASSERT(isOpened, return false);
|
||||
if (offset != 0)
|
||||
file.seek(offset);
|
||||
qint64 res = file.write(data);
|
||||
|
||||
Reference in New Issue
Block a user