Skip to content

Commit ee72079

Browse files
committedDec 8, 2015
Change size()/count() == 0 and count() > 0 to isEmpty() checks
Because: - easier to read - follows recommendations by clazy/KDAB - potentially performance benefits
1 parent 269f709 commit ee72079

File tree

187 files changed

+489
-489
lines changed

Some content is hidden

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

187 files changed

+489
-489
lines changed
 

‎src/analysis/interpolation/DualEdgeTriangulation.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ double leftOfTresh = 0.00000001;
2626
DualEdgeTriangulation::~DualEdgeTriangulation()
2727
{
2828
//remove all the points
29-
if ( mPointVector.count() > 0 )
29+
if ( !mPointVector.isEmpty() )
3030
{
3131
for ( int i = 0; i < mPointVector.count(); i++ )
3232
{
@@ -35,7 +35,7 @@ DualEdgeTriangulation::~DualEdgeTriangulation()
3535
}
3636

3737
//remove all the HalfEdge
38-
if ( mHalfEdge.count() > 0 )
38+
if ( !mHalfEdge.isEmpty() )
3939
{
4040
for ( int i = 0; i < mHalfEdge.count(); i++ )
4141
{
@@ -114,7 +114,7 @@ int DualEdgeTriangulation::addPoint( Point3D* p )
114114
// QgsDebugMsg( QString("inserting point %1,%2//%3//%4").arg(mPointVector.count()).arg(p->getX()).arg(p->getY()).arg(p->getZ()));
115115

116116
//first update the bounding box
117-
if ( mPointVector.count() == 0 )//update bounding box when the first point is inserted
117+
if ( mPointVector.isEmpty() )//update bounding box when the first point is inserted
118118
{
119119
xMin = ( *p ).getX();
120120
yMin = ( *p ).getY();
@@ -743,7 +743,7 @@ void DualEdgeTriangulation::doSwap( unsigned int edge, unsigned int recursiveDee
743743
void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height ) const
744744
{
745745
//if mPointVector is empty, there is nothing to do
746-
if ( mPointVector.count() == 0 )
746+
if ( mPointVector.isEmpty() )
747747
{
748748
return;
749749
}

‎src/analysis/interpolation/NormVecDecorator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
NormVecDecorator::~NormVecDecorator()
2323
{
2424
//remove all the normals
25-
if ( mNormVec->count() > 0 )
25+
if ( !mNormVec->isEmpty() )
2626
{
2727
for ( int i = 0; i < mNormVec->count(); i++ )
2828
{

0 commit comments

Comments
 (0)
Please sign in to comment.