Skip to content

Commit 24b18bc

Browse files
committedOct 16, 2015
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!
1 parent 6a1f1fd commit 24b18bc

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed
 

‎src/app/qgsattributetypedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
8080
QSettings settings;
8181
settings.setValue( "/Windows/QgsAttributeTypeDialog/geometry", saveGeometry() );
8282

83-
qDeleteAll( mEditorConfigWidgets.values() );
83+
qDeleteAll( mEditorConfigWidgets );
8484
}
8585

8686
const QString QgsAttributeTypeDialog::editorWidgetV2Type()

‎src/auth/identcert/qgsauthidentcertmethod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ QgsAuthIdentCertMethod::QgsAuthIdentCertMethod()
4848

4949
QgsAuthIdentCertMethod::~QgsAuthIdentCertMethod()
5050
{
51-
qDeleteAll( mPkiConfigBundleCache.values() );
51+
qDeleteAll( mPkiConfigBundleCache );
5252
mPkiConfigBundleCache.clear();
5353
}
5454

‎src/auth/pkipaths/qgsauthpkipathsmethod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ QgsAuthPkiPathsMethod::QgsAuthPkiPathsMethod()
4848

4949
QgsAuthPkiPathsMethod::~QgsAuthPkiPathsMethod()
5050
{
51-
qDeleteAll( mPkiConfigBundleCache.values() );
51+
qDeleteAll( mPkiConfigBundleCache );
5252
mPkiConfigBundleCache.clear();
5353
}
5454

‎src/auth/pkipkcs12/qgsauthpkcs12method.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ QgsAuthPkcs12Method::QgsAuthPkcs12Method()
4848

4949
QgsAuthPkcs12Method::~QgsAuthPkcs12Method()
5050
{
51-
qDeleteAll( mPkiConfigBundleCache.values() );
51+
qDeleteAll( mPkiConfigBundleCache );
5252
mPkiConfigBundleCache.clear();
5353
}
5454

‎src/core/auth/qgsauthmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ bool QgsAuthManager::registerCoreAuthMethods()
746746
if ( isDisabled() )
747747
return false;
748748

749-
qDeleteAll( mAuthMethods.values() );
749+
qDeleteAll( mAuthMethods );
750750
mAuthMethods.clear();
751751
Q_FOREACH ( const QString& authMethodKey, QgsAuthMethodRegistry::instance()->authMethodList() )
752752
{
@@ -2819,7 +2819,7 @@ QgsAuthManager::~QgsAuthManager()
28192819
if ( !isDisabled() )
28202820
{
28212821
delete QgsAuthMethodRegistry::instance();
2822-
qDeleteAll( mAuthMethods.values() );
2822+
qDeleteAll( mAuthMethods );
28232823

28242824
QSqlDatabase authConn = authDbConnection();
28252825
if ( authConn.isValid() && authConn.isOpen() )

‎src/core/qgsvectorlayerfeatureiterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator()
170170
delete mEditGeometrySimplifier;
171171
mEditGeometrySimplifier = NULL;
172172

173-
qDeleteAll( mExpressionFieldInfo.values() );
173+
qDeleteAll( mExpressionFieldInfo );
174174

175175
close();
176176
}

‎src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ QgsEditorWidgetRegistry::QgsEditorWidgetRegistry()
8181

8282
QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry()
8383
{
84-
qDeleteAll( mWidgetFactories.values() );
84+
qDeleteAll( mWidgetFactories );
8585
}
8686

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

0 commit comments

Comments
 (0)