Skip to content

Commit

Permalink
QgsGeometry::Change operator== should be const
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 20, 2021
1 parent ec8943f commit c2e1ea3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -133,7 +133,9 @@ Create a new Change

QgsVertexId vidx;

bool operator==( const QgsGeometryCheck::Change &other );
bool operator==( const QgsGeometryCheck::Change &other ) const;

bool operator!=( const QgsGeometryCheck::Change &other ) const;
};

typedef QMap<QString, QMap<QgsFeatureId, QList<QgsGeometryCheck::Change> > > Changes;
Expand Down
7 changes: 6 additions & 1 deletion src/analysis/vector/geometry_checker/qgsgeometrycheck.h
Expand Up @@ -202,10 +202,15 @@ class ANALYSIS_EXPORT QgsGeometryCheck
QgsVertexId vidx;

// TODO c++20 - replace with = default
bool operator==( const QgsGeometryCheck::Change &other )
bool operator==( const QgsGeometryCheck::Change &other ) const
{
return what == other.what && type == other.type && vidx == other.vidx;
}

bool operator!=( const QgsGeometryCheck::Change &other ) const
{
return !( *this == other );
}
};

/**
Expand Down

0 comments on commit c2e1ea3

Please sign in to comment.