Skip to content

Commit e74ea28

Browse files
authored
Optimise QgsCoordinateTransform::transformBoundingBox (qgis#59300)
Using std::vector is preferable here, as we don't need implicit sharing of the container or want the extra overhead associated with it
1 parent 5001cc2 commit e74ea28

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/core/proj/qgscoordinatetransform.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,9 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &r
632632
QgsRectangle bb_rect;
633633
bb_rect.setNull();
634634

635-
// We're interfacing with C-style vectors in the
636-
// end, so let's do C-style vectors here too.
637-
QVector<double> x( nXPoints * nYPoints );
638-
QVector<double> y( nXPoints * nYPoints );
639-
QVector<double> z( nXPoints * nYPoints );
635+
std::vector<double> x( nXPoints * static_cast< std::size_t >( nYPoints ) );
636+
std::vector<double> y( nXPoints * static_cast< std::size_t >( nYPoints ) );
637+
std::vector<double> z( nXPoints * static_cast< std::size_t >( nYPoints ) );
640638

641639
QgsDebugMsgLevel( QStringLiteral( "Entering transformBoundingBox..." ), 4 );
642640

0 commit comments

Comments
 (0)