Skip to content

Commit a9f08b0

Browse files
committedJul 28, 2021
QList::removeAt crashes in qt6 if index is -1, so use QList::removeAll instead of QList::removeAt( QList::indexOf(...
1 parent 5b4d6c3 commit a9f08b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/core/classification/qgsclassificationmethod.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ void QgsClassificationMethod::makeBreaksSymmetric( QList<double> &breaks, double
325325
}
326326
}
327327
// remove symmetry point
328-
if ( astride ) // && breaks.indexOf( symmetryPoint ) != -1) // if symmetryPoint is found
328+
if ( astride )
329329
{
330-
breaks.removeAt( breaks.indexOf( symmetryPoint ) );
330+
breaks.removeAll( symmetryPoint );
331331
}
332332
}
333333

‎src/core/qgsrenderchecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bool QgsRenderChecker::isKnownAnomaly( const QString &diffImageFile )
106106
QDir::Files | QDir::NoSymLinks );
107107
//remove the control file from the list as the anomalies are
108108
//all files except the control file
109-
myList.removeAt( myList.indexOf( QFileInfo( mExpectedImageFile ).fileName() ) );
109+
myList.removeAll( QFileInfo( mExpectedImageFile ).fileName() );
110110

111111
QString myImageHash = imageToHash( diffImageFile );
112112

0 commit comments

Comments
 (0)
Please sign in to comment.