From d993684fec07ccf6c3135e16286cd87e045f142c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 15 Jul 2014 14:43:20 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qt-ui/divelistview.cpp') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index eb56d2e03..5fde4c45f 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -199,9 +199,8 @@ void DiveListView::unselectDives() QList DiveListView::selectedTrips() { - QModelIndexList indexes = selectionModel()->selectedRows(); QList ret; - Q_FOREACH (const QModelIndex &index, indexes) { + Q_FOREACH (const QModelIndex &index, selectionModel()->selectedRows()) { dive_trip_t *trip = static_cast(index.data(DiveTripModel::TRIP_ROLE).value()); if (!trip) continue; -- cgit v1.2.3-70-g09d2