Skip to content
Permalink
Browse files

Call qDeleteAll on containers themselves, rather than using

qDeleteAll( container.values() ). The values() call isn't
needed and requires building a QList of values first.

Thanks clazy - keep the good optimisations coming!
  • Loading branch information
nyalldawson committed Oct 16, 2015
1 parent 6a1f1fd commit 24b18bc4265476be227523ed2f3914bd319c8b0c
@@ -80,7 +80,7 @@ QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
QSettings settings;
settings.setValue( "/Windows/QgsAttributeTypeDialog/geometry", saveGeometry() );

qDeleteAll( mEditorConfigWidgets.values() );
qDeleteAll( mEditorConfigWidgets );
}

const QString QgsAttributeTypeDialog::editorWidgetV2Type()
@@ -48,7 +48,7 @@ QgsAuthIdentCertMethod::QgsAuthIdentCertMethod()

QgsAuthIdentCertMethod::~QgsAuthIdentCertMethod()
{
qDeleteAll( mPkiConfigBundleCache.values() );
qDeleteAll( mPkiConfigBundleCache );
mPkiConfigBundleCache.clear();
}

@@ -48,7 +48,7 @@ QgsAuthPkiPathsMethod::QgsAuthPkiPathsMethod()

QgsAuthPkiPathsMethod::~QgsAuthPkiPathsMethod()
{
qDeleteAll( mPkiConfigBundleCache.values() );
qDeleteAll( mPkiConfigBundleCache );
mPkiConfigBundleCache.clear();
}

@@ -48,7 +48,7 @@ QgsAuthPkcs12Method::QgsAuthPkcs12Method()

QgsAuthPkcs12Method::~QgsAuthPkcs12Method()
{
qDeleteAll( mPkiConfigBundleCache.values() );
qDeleteAll( mPkiConfigBundleCache );
mPkiConfigBundleCache.clear();
}

@@ -746,7 +746,7 @@ bool QgsAuthManager::registerCoreAuthMethods()
if ( isDisabled() )
return false;

qDeleteAll( mAuthMethods.values() );
qDeleteAll( mAuthMethods );
mAuthMethods.clear();
Q_FOREACH ( const QString& authMethodKey, QgsAuthMethodRegistry::instance()->authMethodList() )
{
@@ -2819,7 +2819,7 @@ QgsAuthManager::~QgsAuthManager()
if ( !isDisabled() )
{
delete QgsAuthMethodRegistry::instance();
qDeleteAll( mAuthMethods.values() );
qDeleteAll( mAuthMethods );

QSqlDatabase authConn = authDbConnection();
if ( authConn.isValid() && authConn.isOpen() )
@@ -170,7 +170,7 @@ QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator()
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;

qDeleteAll( mExpressionFieldInfo.values() );
qDeleteAll( mExpressionFieldInfo );

close();
}
@@ -81,7 +81,7 @@ QgsEditorWidgetRegistry::QgsEditorWidgetRegistry()

QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry()
{
qDeleteAll( mWidgetFactories.values() );
qDeleteAll( mWidgetFactories );
}

QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::create( const QString& widgetId, QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, QWidget* editor, QWidget* parent, const QgsAttributeEditorContext &context )

0 comments on commit 24b18bc

Please sign in to comment.
You can’t perform that action at this time.