summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-03 10:14:25 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-03 10:14:25 (GMT)
commit69fdb9bc11b303bbfc38274cc56f3ab38f17d6bd (patch)
tree4a05f72e87c0df6beb844fc21d6f15722d5d2995
parentde1208749510aff11ce00d715ad075c8cd38ae0b (diff)
Avoid repeated function calls inside loop
-rw-r--r--src/lib/marble/layers/GeometryLayer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/marble/layers/GeometryLayer.cpp b/src/lib/marble/layers/GeometryLayer.cpp
index f9e205b..4acf5f3 100644
--- a/src/lib/marble/layers/GeometryLayer.cpp
+++ b/src/lib/marble/layers/GeometryLayer.cpp
@@ -133,9 +133,9 @@ bool GeometryLayer::render( GeoPainter *painter, ViewportParams *viewport,
QList<LayerItem> defaultLayer;
int paintedItems = 0;
QHash<QString, QList<GeoGraphicsItem*> > paintedFragments;
- foreach( GeoGraphicsItem* item, items )
- {
- if ( item->latLonAltBox().intersects( viewport->viewLatLonAltBox() ) ) {
+ auto const viewLatLonAltBox = viewport->viewLatLonAltBox();
+ foreach( GeoGraphicsItem* item, items ) {
+ if ( item->latLonAltBox().intersects(viewLatLonAltBox) ) {
QStringList paintLayers = item->paintLayers();
if (paintLayers.isEmpty()) {
mDebug() << item << " provides no paint layers, so I force one onto it.";