summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-01 13:34:11 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-01 13:34:11 (GMT)
commit3c141903adddbf5ae2fa440ae4800ae8cdfc2a0a (patch)
treeb06b136b9cc430447563a035f4f608f687b40fba
parent58dee2489ae6464dda4c4d4d5bc827ec943f5a19 (diff)
Reduce function call overhead
-rw-r--r--src/lib/marble/geodata/data/GeoDataLatLonBox.cpp36
-rw-r--r--src/lib/marble/geodata/data/GeoDataLineString.h4
-rw-r--r--src/lib/marble/geodata/data/GeoDataPlacemark.h4
3 files changed, 22 insertions, 22 deletions
diff --git a/src/lib/marble/geodata/data/GeoDataLatLonBox.cpp b/src/lib/marble/geodata/data/GeoDataLatLonBox.cpp
index f85e020..c0419ad 100644
--- a/src/lib/marble/geodata/data/GeoDataLatLonBox.cpp
+++ b/src/lib/marble/geodata/data/GeoDataLatLonBox.cpp
@@ -434,36 +434,36 @@ bool GeoDataLatLonBox::intersects( const GeoDataLatLonBox &other ) const
// check the intersection criterion for the latitude first:
- // Case 1: northern boundary of other box intersects:
- if ( ( d->m_north >= other.north() && d->m_south <= other.north() )
+ // Case 1: northern boundary of other box intersects:
+ if ( (d->m_north >= other.d->m_north && d->m_south <= other.d->m_north)
// Case 2: northern boundary of this box intersects:
- || ( other.north() >= d->m_north && other.south() <= d->m_north )
+ || (other.d->m_north >= d->m_north && other.d->m_south <= d->m_north)
// Case 3: southern boundary of other box intersects:
- || ( d->m_north >= other.south() && d->m_south <= other.south() )
+ || (d->m_north >= other.d->m_south && d->m_south <= other.d->m_south)
// Case 4: southern boundary of this box intersects:
- || ( other.north() >= d->m_south && other.south() <= d->m_south ) ) {
+ || (other.d->m_north >= d->m_south && other.d->m_south <= d->m_south)) {
if ( !crossesDateLine() ) {
if ( !other.crossesDateLine() ) {
// "Normal" case: both bounding boxes don't cross the date line
- // Case 1: eastern boundary of other box intersects:
- if ( ( d->m_east >= other.east() && d->m_west <= other.east() )
+ // Case 1: eastern boundary of other box intersects:
+ if ( (d->m_east >= other.d->m_east && d->m_west <= other.d->m_east)
// Case 2: eastern boundary of this box intersects:
- || ( other.east() >= d->m_east && other.west() <= d->m_east )
+ || (other.d->m_east >= d->m_east && other.d->m_west <= d->m_east)
// Case 3: western boundary of other box intersects:
- || ( d->m_east >= other.west() && d->m_west <= other.west() )
+ || (d->m_east >= other.d->m_west && d->m_west <= other.d->m_west)
// Case 4: western boundary of this box intersects:
- || ( other.east() >= d->m_west && other.west() <= d->m_west ) ) {
+ || (other.d->m_east >= d->m_west && other.d->m_west <= d->m_west)) {
return true;
- }
+ }
}
else {
// The other bounding box crosses the date line, "this" one does not:
// So the date line splits the other bounding box in two parts.
- if ( d->m_west <= other.east() || d->m_east >= other.west() ) {
- return true;
- }
+ if ( d->m_west <= other.d->m_east || d->m_east >= other.d->m_west) {
+ return true;
+ }
}
}
else {
@@ -474,12 +474,12 @@ bool GeoDataLatLonBox::intersects( const GeoDataLatLonBox &other ) const
else {
// "This" bounding box crosses the date line, the other one does not.
// So the date line splits "this" bounding box in two parts.
- //
+ //
// This also covers the case where this bounding box covers the whole
// longitude range ( -180 <= lon <= + 180 ).
- if ( other.west() <= d->m_east || other.east() >= d->m_west ) {
- return true;
- }
+ if ( other.d->m_west <= d->m_east || other.d->m_east >= d->m_west ) {
+ return true;
+ }
}
}
}
diff --git a/src/lib/marble/geodata/data/GeoDataLineString.h b/src/lib/marble/geodata/data/GeoDataLineString.h
index f78a857..fb94cbe 100644
--- a/src/lib/marble/geodata/data/GeoDataLineString.h
+++ b/src/lib/marble/geodata/data/GeoDataLineString.h
@@ -385,8 +385,8 @@ class GEODATA_EXPORT GeoDataLineString : public GeoDataGeometry
explicit GeoDataLineString(GeoDataLineStringPrivate* priv);
private:
- GeoDataLineStringPrivate *p();
- const GeoDataLineStringPrivate *p() const;
+ inline GeoDataLineStringPrivate *p();
+ inline const GeoDataLineStringPrivate *p() const;
};
}
diff --git a/src/lib/marble/geodata/data/GeoDataPlacemark.h b/src/lib/marble/geodata/data/GeoDataPlacemark.h
index 47f3a40..541465b 100644
--- a/src/lib/marble/geodata/data/GeoDataPlacemark.h
+++ b/src/lib/marble/geodata/data/GeoDataPlacemark.h
@@ -242,8 +242,8 @@ class GEODATA_EXPORT GeoDataPlacemark: public GeoDataFeature
static bool placemarkLayoutOrderCompare(const GeoDataPlacemark *a, const GeoDataPlacemark* b);
private:
- GeoDataPlacemarkPrivate *p();
- const GeoDataPlacemarkPrivate *p() const;
+ inline GeoDataPlacemarkPrivate *p();
+ inline const GeoDataPlacemarkPrivate *p() const;
};
}