Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Silence some cppcheck false positives
  • Loading branch information
nyalldawson committed Apr 15, 2023
1 parent 29b9c38 commit 90d3220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/geometry/qgsinternalgeometryengine.cpp
Expand Up @@ -884,8 +884,10 @@ bool QgsLineSegmentDistanceComparer::operator()( QgsLineSegment2D ab, QgsLineSeg

// flip the segments so that if there are common endpoints,
// they will be the segment's start points
// cppcheck-suppress mismatchingContainerExpression
if ( ab.end() == cd.start() || ab.end() == cd.end() )
ab.reverse();
// cppcheck-suppress mismatchingContainerExpression
if ( ab.start() == cd.end() )
cd.reverse();

Expand All @@ -894,6 +896,7 @@ bool QgsLineSegmentDistanceComparer::operator()( QgsLineSegment2D ab, QgsLineSeg
{
const int oad = QgsGeometryUtils::leftOfLine( cd.endX(), cd.endY(), mOrigin.x(), mOrigin.y(), ab.startX(), ab.startY() );
const int oab = ab.pointLeftOfLine( mOrigin );
// cppcheck-suppress mismatchingContainerExpression
if ( ab.end() == cd.end() || oad != oab )
return false;
else
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsrange.h
Expand Up @@ -620,6 +620,7 @@ class QgsTemporalRange
return {};

QList< QgsTemporalRange<T > > sortedRanges = ranges;
// cppcheck-suppress mismatchingContainerExpression
std::sort( sortedRanges.begin(), sortedRanges.end(), []( const QgsTemporalRange< T > &a, const QgsTemporalRange< T > &b ) -> bool { return a.begin() < b.begin(); } );
QList< QgsTemporalRange<T>> res;
res.reserve( sortedRanges.size() );
Expand Down

0 comments on commit 90d3220

Please sign in to comment.