Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 24b18bc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsattributetypedialog.cpp
Expand Up @@ -80,7 +80,7 @@ QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
QSettings settings;
settings.setValue( "/Windows/QgsAttributeTypeDialog/geometry", saveGeometry() );

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

const QString QgsAttributeTypeDialog::editorWidgetV2Type()
Expand Down
2 changes: 1 addition & 1 deletion src/auth/identcert/qgsauthidentcertmethod.cpp
Expand Up @@ -48,7 +48,7 @@ QgsAuthIdentCertMethod::QgsAuthIdentCertMethod()

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

Expand Down
2 changes: 1 addition & 1 deletion src/auth/pkipaths/qgsauthpkipathsmethod.cpp
Expand Up @@ -48,7 +48,7 @@ QgsAuthPkiPathsMethod::QgsAuthPkiPathsMethod()

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

Expand Down
2 changes: 1 addition & 1 deletion src/auth/pkipkcs12/qgsauthpkcs12method.cpp
Expand Up @@ -48,7 +48,7 @@ QgsAuthPkcs12Method::QgsAuthPkcs12Method()

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

Expand Down
4 changes: 2 additions & 2 deletions src/core/auth/qgsauthmanager.cpp
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -2819,7 +2819,7 @@ QgsAuthManager::~QgsAuthManager()
if ( !isDisabled() )
{
delete QgsAuthMethodRegistry::instance();
qDeleteAll( mAuthMethods.values() );
qDeleteAll( mAuthMethods );

QSqlDatabase authConn = authDbConnection();
if ( authConn.isValid() && authConn.isOpen() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -170,7 +170,7 @@ QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator()
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;

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

close();
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 24b18bc

Please sign in to comment.