Skip to content

Commit 850171c

Browse files
committed
Optimise destructors (pt 1)
- Remove some non-base class empty destructors. These add no value and it's better to let the compiler auto generate optimised versions - use virtual ~Class = default instead of virtual ~Class {}
1 parent 9021bb4 commit 850171c

134 files changed

Lines changed: 50 additions & 313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/analysis/interpolation/HalfEdge.h‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ANALYSIS_EXPORT HalfEdge
3838
//! Default constructor. Values for mDual, mNext, mPoint are set to -10 which means that they are undefined
3939
HalfEdge();
4040
HalfEdge( int dual, int next, int point, bool mbreak, bool forced );
41-
~HalfEdge();
41+
4242
//! Returns the number of the dual HalfEdge
4343
int getDual() const;
4444
//! Returns the number of the next HalfEdge
@@ -71,11 +71,6 @@ inline HalfEdge::HalfEdge( int dual, int next, int point, bool mbreak, bool forc
7171

7272
}
7373

74-
inline HalfEdge::~HalfEdge()
75-
{
76-
77-
}
78-
7974
inline int HalfEdge::getDual() const
8075
{
8176
return mDual;

‎src/analysis/interpolation/Point3D.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ANALYSIS_EXPORT Point3D
3535
//! Constructor with the x-, y- and z-coordinate as arguments
3636
Point3D( double x, double y, double z );
3737
Point3D( const Point3D& p );
38-
~Point3D();
3938
Point3D& operator=( const Point3D& p );
4039
bool operator==( const Point3D& p ) const;
4140
bool operator!=( const Point3D& p ) const;
@@ -76,11 +75,6 @@ inline Point3D::Point3D( const Point3D& p ): mX( p.mX ), mY( p.mY ), mZ( p.mZ )
7675

7776
}
7877

79-
inline Point3D::~Point3D()
80-
{
81-
82-
}
83-
8478
inline double Point3D::getX() const
8579
{
8680
return mX;

‎src/analysis/interpolation/TriangleInterpolator.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class ANALYSIS_EXPORT TriangleInterpolator
2626
{
2727
public:
28-
virtual ~TriangleInterpolator() {}
28+
virtual ~TriangleInterpolator() = default;
2929
//! Calculates the normal vector and assigns it to vec
3030
virtual bool calcNormVec( double x, double y, Vector3D* result ) = 0;
3131
//! Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point

‎src/analysis/interpolation/Vector3D.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class ANALYSIS_EXPORT Vector3D
4343
//! Copy constructor
4444
Vector3D( const Vector3D& v );
4545

46-
~Vector3D();
4746
Vector3D& operator=( const Vector3D& v );
4847
bool operator==( const Vector3D& v ) const;
4948
bool operator!=( const Vector3D& v ) const;
@@ -83,11 +82,6 @@ inline Vector3D::Vector3D()
8382

8483
}
8584

86-
inline Vector3D::~Vector3D()
87-
{
88-
89-
}
90-
9185
//-------------------------------------------setter and getters-------------------------------
9286

9387
inline double Vector3D::getX() const

‎src/analysis/interpolation/qgsidwinterpolator.cpp‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ QgsIDWInterpolator::QgsIDWInterpolator(): QgsInterpolator( QList<LayerData>() ),
2929

3030
}
3131

32-
QgsIDWInterpolator::~QgsIDWInterpolator()
33-
{
34-
35-
}
36-
3732
int QgsIDWInterpolator::interpolatePoint( double x, double y, double& result )
3833
{
3934
if ( !mDataIsCached )

‎src/analysis/interpolation/qgsidwinterpolator.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ANALYSIS_EXPORT QgsIDWInterpolator: public QgsInterpolator
2727
{
2828
public:
2929
QgsIDWInterpolator( const QList<LayerData>& layerData );
30-
~QgsIDWInterpolator();
3130

3231
/** Calculates interpolation value for map coordinates x, y
3332
@param x x-coordinate (in map units)

‎src/analysis/network/qgsnetworkstrategy.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ANALYSIS_EXPORT QgsNetworkStrategy
3939
*/
4040
QgsNetworkStrategy() {}
4141

42-
virtual ~QgsNetworkStrategy() {}
42+
virtual ~QgsNetworkStrategy() = default;
4343

4444
/**
4545
* Returns list of the source layer attributes needed for cost calculation.

‎src/analysis/raster/qgsalignraster.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
147147
//! @return false if the execution should be cancelled, true otherwise
148148
virtual bool progress( double complete ) = 0;
149149

150-
virtual ~ProgressHandler() {}
150+
virtual ~ProgressHandler() = default;
151151
};
152152

153153
//! Assign a progress handler instance. Does not take ownership. nullptr can be passed.

‎src/analysis/raster/qgsaspectfilter.cpp‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ QgsAspectFilter::QgsAspectFilter( const QString& inputFile, const QString& outpu
2323

2424
}
2525

26-
QgsAspectFilter::~QgsAspectFilter()
27-
{
28-
29-
}
30-
3126
float QgsAspectFilter::processNineCellWindow(
3227
float* x11, float* x21, float* x31,
3328
float* x12, float* x22, float* x32,

‎src/analysis/raster/qgsaspectfilter.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class ANALYSIS_EXPORT QgsAspectFilter: public QgsDerivativeFilter
2626
{
2727
public:
2828
QgsAspectFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
29-
~QgsAspectFilter();
3029

3130
/** Calculates output value from nine input values. The input values and the output value can be equal to the
3231
nodata value if not present or outside of the border. Must be implemented by subclasses*/

0 commit comments

Comments
 (0)