diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-15 14:43:20 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-15 16:55:10 -0700 |
commit | d993684fec07ccf6c3135e16286cd87e045f142c (patch) | |
tree | 03f59a88719625ca03cd8fccba3f17ddbc85c569 /qt-ui/models.cpp | |
parent | eaacac321743434ce8610b4b61f56a3fe4a63567 (diff) | |
download | subsurface-d993684fec07ccf6c3135e16286cd87e045f142c.tar.gz |
Do not create a backup for Q_FOREACH container
Q_FOREACH will expand and already creates a copy of the
contained container, so this is just a waste of cpu cycles
and also increases a tiny bit the memory consumption.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index ca6f6375f..a0bb97aa7 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -2035,8 +2035,7 @@ LanguageModel::LanguageModel(QObject *parent) : QAbstractListModel(parent) { QSettings s; QDir d(getSubsurfaceDataPath("translations")); - QStringList result = d.entryList(); - Q_FOREACH (const QString &s, result) { + Q_FOREACH (const QString &s, d.entryList()) { if (s.startsWith("subsurface_") && s.endsWith(".qm")) { languages.push_back((s == "subsurface_source.qm") ? "English" : s); } |