Fix use of QString

We should use references when we are not wanting to make a copy
of it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-11-13 17:37:54 -02:00 committed by Dirk Hohndel
parent e7e58bf9ea
commit 01cd09c77a

View file

@ -324,7 +324,6 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered)
{ {
int i, j; int i, j;
struct dive *d; struct dive *d;
QString gas;
QMap<QString, int> gasUsed; QMap<QString, int> gasUsed;
for_each_dive (i, d) { for_each_dive (i, d) {
if (!d->selected) if (!d->selected)
@ -337,7 +336,7 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered)
gasUsed[gasName] += diveGases[j].mliter; gasUsed[gasName] += diveGases[j].mliter;
} }
} }
Q_FOREACH(gas, gasUsed.keys()) { Q_FOREACH(const QString& gas, gasUsed.keys()) {
gasUsedOrdered.append(qMakePair(gas, gasUsed[gas])); gasUsedOrdered.append(qMakePair(gas, gasUsed[gas]));
} }
qSort(gasUsedOrdered.begin(), gasUsedOrdered.end(), lessThan); qSort(gasUsedOrdered.begin(), gasUsedOrdered.end(), lessThan);