diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-23 13:44:12 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-26 15:13:34 +0000 |
commit | 5163c11952a39458dd6d7ba10391c2b39ccdf86a (patch) | |
tree | 98c03a10d5c9e51a5aa6f950d642ee6a7b93031f /src/qml/qml/qqmlmetatype.cpp | |
parent | a7c0e62b9122a8d210149570be8834401b9b36d3 (diff) |
QtQml: Micro-optimize iterator loops.
Avoid repeated instantiation of end() in loops, use variable instead.
Change-Id: I3bb1c6918cfd16a5dcefbcc03c442e99fe9bf76b
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 6dc18b4b05..9779773b05 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -143,8 +143,7 @@ QQmlMetaTypeData::~QQmlMetaTypeData() for (int i = 0; i < types.count(); ++i) delete types.at(i); - TypeModules::const_iterator i = uriToModule.constBegin(); - for (; i != uriToModule.constEnd(); ++i) + for (TypeModules::const_iterator i = uriToModule.constBegin(), cend = uriToModule.constEnd(); i != cend; ++i) delete *i; } @@ -1096,8 +1095,7 @@ void qmlClearTypeRegistrations() // Declared in qqml.h for (int i = 0; i < data->types.count(); ++i) delete data->types.at(i); - QQmlMetaTypeData::TypeModules::const_iterator i = data->uriToModule.constBegin(); - for (; i != data->uriToModule.constEnd(); ++i) + for (QQmlMetaTypeData::TypeModules::const_iterator i = data->uriToModule.constBegin(), cend = data->uriToModule.constEnd(); i != cend; ++i) delete *i; data->types.clear(); |