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:
parent
efb90f6e7e
commit
7eeda336b4
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user