forked from qt-creator/qt-creator
CorePlugin: 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: I95593962486e1de1b980f17b8f924d6f98fa8e80 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -132,7 +132,8 @@ QString UtilsJsExtension::mktemp(const QString &pattern) const
|
|||||||
|
|
||||||
QTemporaryFile file(tmp);
|
QTemporaryFile file(tmp);
|
||||||
file.setAutoRemove(false);
|
file.setAutoRemove(false);
|
||||||
QTC_ASSERT(file.open(), return QString());
|
const bool isOpen = file.open();
|
||||||
|
QTC_ASSERT(isOpen, return {});
|
||||||
file.close();
|
file.close();
|
||||||
return file.fileName();
|
return file.fileName();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user