Skip to content

Commit

Permalink
Fix some places we should be using const ref for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 15, 2024
1 parent 551c2c3 commit c343317
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/labeling/qgslabelingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ void QgsLabelingEngine::drawLabelCandidateRect( pal::LabelPosition *lp, QgsRende
drawLabelCandidateRect( lp->nextPart(), context, xform, candidates );
}

void QgsLabelingEngine::drawLabelMetrics( pal::LabelPosition *label, QgsMapToPixel xform, QgsRenderContext &context, const QPointF &renderPoint )
void QgsLabelingEngine::drawLabelMetrics( pal::LabelPosition *label, const QgsMapToPixel &xform, QgsRenderContext &context, const QPointF &renderPoint )
{
QPainter *painter = context.painter();
if ( !painter )
Expand Down
2 changes: 1 addition & 1 deletion src/core/labeling/qgslabelingengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class CORE_EXPORT QgsLabelingEngine
*
* \see drawLabelCandidateRect()
*/
static void drawLabelMetrics( pal::LabelPosition *label, QgsMapToPixel xform, QgsRenderContext &context, const QPointF &renderPoint );
static void drawLabelMetrics( pal::LabelPosition *label, const QgsMapToPixel &xform, QgsRenderContext &context, const QPointF &renderPoint );

protected:
void processProvider( QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p );
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgscopcpointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ QgsPointCloudStatistics QgsCopcPointCloudIndex::metadataStatistics() const
{
if ( ! mStatistics )
{
QByteArray statisticsEvlrData = fetchCopcStatisticsEvlrData();
const QByteArray statisticsEvlrData = fetchCopcStatisticsEvlrData();
if ( statisticsEvlrData.isEmpty() )
mStatistics = QgsPointCloudIndex::metadataStatistics();
else
Expand Down
13 changes: 10 additions & 3 deletions src/core/pointcloud/qgspointcloudindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,16 @@ class CORE_EXPORT QgsPointCloudNode
* Constructs new node object. Should only be called by QgsPointCloudIndex::getNode().
* Bounds should always be computed by QgsPointCloudNode::bounds().
*/
QgsPointCloudNode( QgsPointCloudNodeId id, qint64 pointCount,
QList<QgsPointCloudNodeId> childIds, float error, QgsBox3D bounds )
: mId( id ), mPointCount( pointCount ), mChildIds( childIds ), mError( error ), mBounds( bounds )
QgsPointCloudNode( const QgsPointCloudNodeId &id,
qint64 pointCount,
const QList<QgsPointCloudNodeId> &childIds,
float error,
const QgsBox3D &bounds )
: mId( id )
, mPointCount( pointCount )
, mChildIds( childIds )
, mError( error )
, mBounds( bounds )
{
}
//! Returns node's ID (unique in index)
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ QByteArray QgsPointCloudStatistics::toStatisticsJson() const
return statsDoc.toJson( QJsonDocument::Compact );
}

QgsPointCloudStatistics QgsPointCloudStatistics::fromStatisticsJson( QByteArray statsByteArray )
QgsPointCloudStatistics QgsPointCloudStatistics::fromStatisticsJson( const QByteArray &statsByteArray )
{
QJsonParseError error;
QJsonDocument document = QJsonDocument::fromJson( statsByteArray, &error );
Expand Down

0 comments on commit c343317

Please sign in to comment.