Skip to content

Commit 7e81226

Browse files
rouaultnyalldawson
authored andcommitted
Replace toUtf8().data() by toUtf8().constData()
All your uses of toUtf8().data() actually just need a const char* So use constData() that is semantically more correct, and documented to be faster. From http://doc.qt.io/qt-5/qbytearray.html#data "For read-only access, constData() is faster because it never causes a deep copy to occur."
1 parent f5d2d85 commit 7e81226

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+100
-100
lines changed

python/core/auto_generated/expression/qgsexpression.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ value. The value may be null.
590590
SIP_PYOBJECT __repr__();
591591
%MethodCode
592592
QString str = QStringLiteral( "<QgsExpression: '%1'>" ).arg( sipCpp->expression() );
593-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
593+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
594594
%End
595595

596596
};

python/core/auto_generated/geometry/qgscircle.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Returns true if the circle contains the ``point``.
256256
SIP_PYOBJECT __repr__();
257257
%MethodCode
258258
QString str = QStringLiteral( "<QgsCircle: %1>" ).arg( sipCpp->toString() );
259-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
259+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
260260
%End
261261
};
262262

python/core/auto_generated/geometry/qgscircularstring.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Sets the circular string's points
169169
SIP_PYOBJECT __repr__();
170170
%MethodCode
171171
QString str = QStringLiteral( "<QgsCircularString: %1>" ).arg( sipCpp->asWkt() );
172-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
172+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
173173
%End
174174

175175
protected:

python/core/auto_generated/geometry/qgscompoundcurve.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Appends first point if not already closed.
173173
SIP_PYOBJECT __repr__();
174174
%MethodCode
175175
QString str = QStringLiteral( "<QgsCompoundCurve: %1>" ).arg( sipCpp->asWkt() );
176-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
176+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
177177
%End
178178

179179
protected:

python/core/auto_generated/geometry/qgscurvepolygon.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Returns approximate rotation angle for a vertex. Usually average angle between a
219219
SIP_PYOBJECT __repr__();
220220
%MethodCode
221221
QString str = QStringLiteral( "<QgsCurvePolygon: %1>" ).arg( sipCpp->asWkt() );
222-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
222+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
223223
%End
224224

225225
protected:

python/core/auto_generated/geometry/qgsellipse.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Members will be truncated to the specified precision.
251251
SIP_PYOBJECT __repr__();
252252
%MethodCode
253253
QString str = QStringLiteral( "<QgsEllipse: %1>" ).arg( sipCpp->toString() );
254-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
254+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
255255
%End
256256

257257
protected:

python/core/auto_generated/geometry/qgsgeometry.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ Exports the geometry to WKT
12971297
SIP_PYOBJECT __repr__();
12981298
%MethodCode
12991299
QString str = QStringLiteral( "<QgsGeometry: %1>" ).arg( sipCpp->asWkt() );
1300-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
1300+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
13011301
%End
13021302

13031303
QString asJson( int precision = 17 ) const;

python/core/auto_generated/geometry/qgslinestring.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ of the curve.
330330
SIP_PYOBJECT __repr__();
331331
%MethodCode
332332
QString str = QStringLiteral( "<QgsLineString: %1>" ).arg( sipCpp->asWkt() );
333-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
333+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
334334
%End
335335

336336
protected:

python/core/auto_generated/geometry/qgsmulticurve.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Returns a copy of the multi curve, where each component curve has had its line d
5959
SIP_PYOBJECT __repr__();
6060
%MethodCode
6161
QString str = QStringLiteral( "<QgsMultiCurve: %1>" ).arg( sipCpp->asWkt() );
62-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
62+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
6363
%End
6464

6565
};

python/core/auto_generated/geometry/qgsmultilinestring.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Returns the geometry converted to the more generic curve type :py:class:`QgsMult
5656
SIP_PYOBJECT __repr__();
5757
%MethodCode
5858
QString str = QStringLiteral( "<QgsMultiLineString: %1>" ).arg( sipCpp->asWkt() );
59-
sipRes = PyUnicode_FromString( str.toUtf8().data() );
59+
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
6060
%End
6161

6262
protected:

0 commit comments

Comments
 (0)