forked from qt-creator/qt-creator
Fix occurrences of the contains/insert anti-pattern
Introduce and make use of Utils::insert() for QSet with a return value that indicates whether insertion actually happened. Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/completionsettings.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
@@ -261,10 +262,9 @@ private:
|
||||
|
||||
void processProperties(const ObjectValue *object)
|
||||
{
|
||||
if (! object || _processed.contains(object))
|
||||
if (! object || !Utils::insert(_processed, object))
|
||||
return;
|
||||
|
||||
_processed.insert(object);
|
||||
processProperties(object->prototype(_scopeChain->context()));
|
||||
|
||||
_currentObject = object;
|
||||
|
||||
Reference in New Issue
Block a user