summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-12-16 15:54:02 +0100
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2013-12-16 16:03:16 +0100
commitdc6b28366c971b9f1cb0b2c5f665c01b3ba47d68 (patch)
tree52fe9a2ececfa593ab916064331c2d3302df0de9 /src
parent6c56a065d97e24f65f03c3a5cae1d2eac3f2147f (diff)
downloadqt-creator-dc6b28366c971b9f1cb0b2c5f665c01b3ba47d68.tar.gz
Avoid value-list creation when iterating over maps.
Change-Id: I704ba93d01ffababb405bc801f07a845631930cc Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp2
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp2
-rw-r--r--src/plugins/projectexplorer/kit.cpp2
-rw-r--r--src/plugins/projectexplorer/targetsetuppage.cpp8
-rw-r--r--src/plugins/qmlprofiler/qv8profilerdatamodel.cpp12
5 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
index a4b2080e93..b57c5fbfee 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
@@ -336,7 +336,7 @@ QList<Command *> ActionManager::commands()
{
// transform list of CommandPrivate into list of Command
QList<Command *> result;
- foreach (Command *cmd, d->m_idCmdMap.values())
+ foreach (Command *cmd, d->m_idCmdMap)
result << cmd;
return result;
}
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index c2a3792c93..fc6b6204b5 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -411,7 +411,7 @@ void CppEditorSupport::onDiagnosticsChanged()
QList<Document::DiagnosticMessage> allDiagnostics;
{
QMutexLocker locker(&m_diagnosticsMutex);
- foreach (const QList<Document::DiagnosticMessage> &msgs, m_allDiagnostics.values())
+ foreach (const QList<Document::DiagnosticMessage> &msgs, m_allDiagnostics)
allDiagnostics.append(msgs);
}
diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp
index 1676d4a30e..844ae4e388 100644
--- a/src/plugins/projectexplorer/kit.cpp
+++ b/src/plugins/projectexplorer/kit.cpp
@@ -433,7 +433,7 @@ QVariantMap Kit::toMap() const
data.insert(QLatin1String(ICON_KEY), d->m_iconPath.toString());
QStringList mutableInfo;
- foreach (const Core::Id &id, d->m_mutable.values())
+ foreach (const Core::Id &id, d->m_mutable)
mutableInfo << id.toString();
data.insert(QLatin1String(MUTABLE_INFO_KEY), mutableInfo);
diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp
index b47da13ed3..c91d80b9ca 100644
--- a/src/plugins/projectexplorer/targetsetuppage.cpp
+++ b/src/plugins/projectexplorer/targetsetuppage.cpp
@@ -246,7 +246,7 @@ void TargetSetupPage::setKitSelected(Core::Id id, bool selected)
bool TargetSetupPage::isComplete() const
{
- foreach (TargetSetupWidget *widget, m_widgets.values())
+ foreach (TargetSetupWidget *widget, m_widgets)
if (widget->isKitSelected())
return true;
return false;
@@ -275,7 +275,7 @@ void TargetSetupPage::setupWidgets()
void TargetSetupPage::reset()
{
- foreach (TargetSetupWidget *widget, m_widgets.values()) {
+ foreach (TargetSetupWidget *widget, m_widgets) {
Kit *k = widget->kit();
if (!k)
continue;
@@ -386,7 +386,7 @@ void TargetSetupPage::handleKitUpdate(Kit *k)
void TargetSetupPage::selectAtLeastOneKit()
{
bool atLeastOneKitSelected = false;
- foreach (TargetSetupWidget *w, m_widgets.values()) {
+ foreach (TargetSetupWidget *w, m_widgets) {
if (w->isKitSelected()) {
atLeastOneKitSelected = true;
break;
@@ -514,7 +514,7 @@ TargetSetupWidget *TargetSetupPage::addWidget(Kit *k)
bool TargetSetupPage::setupProject(Project *project)
{
QList<const BuildInfo *> toSetUp; // Pointers are managed by the widgets!
- foreach (TargetSetupWidget *widget, m_widgets.values()) {
+ foreach (TargetSetupWidget *widget, m_widgets) {
if (!widget->isKitSelected())
continue;
diff --git a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
index fd45bc0e47..6ce3e54d15 100644
--- a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
+++ b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
@@ -138,7 +138,7 @@ bool QV8ProfilerDataModel::isEmpty() const
QV8EventData *QV8ProfilerDataModel::v8EventDescription(int eventId) const
{
- foreach (QV8EventData *event, d->v8EventHash.values()) {
+ foreach (QV8EventData *event, d->v8EventHash) {
if (event->eventId == eventId)
return event;
}
@@ -235,7 +235,7 @@ void QV8ProfilerDataModel::QV8ProfilerDataModelPrivate::collectV8Statistics()
if (!v8EventHash.isEmpty()) {
double totalTimes = v8MeasuredTime;
double selfTimes = 0;
- foreach (QV8EventData *v8event, v8EventHash.values()) {
+ foreach (const QV8EventData *v8event, v8EventHash) {
selfTimes += v8event->selfTime;
}
@@ -261,7 +261,7 @@ void QV8ProfilerDataModel::QV8ProfilerDataModelPrivate::collectV8Statistics()
*v8EventHash[rootEventHash] = v8RootEvent;
}
- foreach (QV8EventData *v8event, v8EventHash.values()) {
+ foreach (QV8EventData *v8event, v8EventHash) {
v8event->totalPercent = v8event->totalTime * 100.0 / totalTimes;
v8event->SelfTimeInPercent = v8event->selfTime * 100.0 / selfTimes;
}
@@ -300,7 +300,7 @@ void QV8ProfilerDataModel::save(QXmlStreamWriter &stream)
{
stream.writeStartElement(QLatin1String("v8profile")); // v8 profiler output
stream.writeAttribute(QLatin1String("totalTime"), QString::number(d->v8MeasuredTime));
- foreach (QV8EventData *v8event, d->v8EventHash.values()) {
+ foreach (const QV8EventData *v8event, d->v8EventHash) {
stream.writeStartElement(QLatin1String("event"));
stream.writeAttribute(QLatin1String("index"),
QString::number(
@@ -319,7 +319,7 @@ void QV8ProfilerDataModel::save(QXmlStreamWriter &stream)
QStringList childrenIndexes;
QStringList childrenTimes;
QStringList parentTimes;
- foreach (QV8EventSub *v8child, v8event->childrenHash.values()) {
+ foreach (const QV8EventSub *v8child, v8event->childrenHash) {
childrenIndexes << QString::number(v8child->reference->eventId);
childrenTimes << QString::number(v8child->totalTime);
parentTimes << QString::number(v8child->totalTime);
@@ -468,7 +468,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream)
}
}
// store v8 events
- foreach (QV8EventData *storedV8Event, v8eventBuffer.values()) {
+ foreach (QV8EventData *storedV8Event, v8eventBuffer) {
storedV8Event->eventHashStr =
getHashStringForV8Event(
storedV8Event->displayName, storedV8Event->functionName);