aboutsummaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-11-13 17:37:54 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-13 12:10:21 -0800
commit01cd09c77a4be0ea7072e0cefac62f07c4a29c27 (patch)
tree14861e42fb050ad686c784b7c0a638c3c9b4baa7 /qthelper.cpp
parente7e58bf9ea2aa80b6130e0201a6b365449529c60 (diff)
downloadsubsurface-01cd09c77a4be0ea7072e0cefac62f07c4a29c27.tar.gz
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>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index e165e85ad..0c1c68ab1 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -324,7 +324,6 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered)
{
int i, j;
struct dive *d;
- QString gas;
QMap<QString, int> gasUsed;
for_each_dive (i, d) {
if (!d->selected)
@@ -337,7 +336,7 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered)
gasUsed[gasName] += diveGases[j].mliter;
}
}
- Q_FOREACH(gas, gasUsed.keys()) {
+ Q_FOREACH(const QString& gas, gasUsed.keys()) {
gasUsedOrdered.append(qMakePair(gas, gasUsed[gas]));
}
qSort(gasUsedOrdered.begin(), gasUsedOrdered.end(), lessThan);