Switch a comma operator to a IILE

A comma operator results in a discarded-value expression, meaning the
compiler is going to complain the moment we mark QMutexLocker as
nodiscard. Turn the comma into a functionally equivalent IILE.

Change-Id: I33826902c8471016490aac25160b70c609dafd90
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2021-09-19 11:47:10 +02:00
parent efb90f6e7e
commit 7eeda336b4

View File

@ -548,7 +548,7 @@ void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh)
QObject *QLibraryPrivate::pluginInstance()
{
// first, check if the instance is cached and hasn't been deleted
QObject *obj = (QMutexLocker(&mutex), inst.data());
QObject *obj = [&](){ QMutexLocker locker(&mutex); return inst.data(); }();
if (obj)
return obj;