Skip to content

Commit e7f2f78

Browse files
committed
More efficient use of strings
1 parent 92f0327 commit e7f2f78

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/core/qgscoordinatereferencesystem.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
758758
int myLength1 = 0;
759759
int myStart2 = 0;
760760
int myLength2 = 0;
761-
QString lat1Str = QLatin1String( "" );
762-
QString lat2Str = QLatin1String( "" );
761+
QString lat1Str;
762+
QString lat2Str;
763763
myStart1 = myLat1RegExp.indexIn( myProj4String, myStart1 );
764764
myStart2 = myLat2RegExp.indexIn( myProj4String, myStart2 );
765765
if ( myStart1 != -1 && myStart2 != -1 )
@@ -770,7 +770,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
770770
lat2Str = myProj4String.mid( myStart2 + LAT_PREFIX_LEN, myLength2 - LAT_PREFIX_LEN );
771771
}
772772
// If we found the lat_1 and lat_2 we need to swap and check to see if we can find it...
773-
if ( lat1Str != QLatin1String( "" ) && lat2Str != QLatin1String( "" ) )
773+
if ( !lat1Str.isEmpty() && !lat2Str.isEmpty() )
774774
{
775775
// Make our new string to check...
776776
QString proj4StringModified = myProj4String;
@@ -793,7 +793,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
793793
// - retry without datum, if no match is found (looks like +datum<>WGS84 was dropped in GDAL)
794794

795795
QString sql = QStringLiteral( "SELECT * FROM tbl_srs WHERE " );
796-
QString delim = QLatin1String( "" );
796+
QString delim;
797797
QString datum;
798798

799799
// split on spaces followed by a plus sign (+) to deal
@@ -1022,7 +1022,7 @@ QString QgsCoordinateReferenceSystem::description() const
10221022
{
10231023
if ( d->mDescription.isNull() )
10241024
{
1025-
return QLatin1String( "" );
1025+
return QString();
10261026
}
10271027
else
10281028
{
@@ -1034,7 +1034,7 @@ QString QgsCoordinateReferenceSystem::projectionAcronym() const
10341034
{
10351035
if ( d->mProjectionAcronym.isNull() )
10361036
{
1037-
return QLatin1String( "" );
1037+
return QString();
10381038
}
10391039
else
10401040
{
@@ -1046,7 +1046,7 @@ QString QgsCoordinateReferenceSystem::ellipsoidAcronym() const
10461046
{
10471047
if ( d->mEllipsoidAcronym.isNull() )
10481048
{
1049-
return QLatin1String( "" );
1049+
return QString();
10501050
}
10511051
else
10521052
{
@@ -1057,7 +1057,7 @@ QString QgsCoordinateReferenceSystem::ellipsoidAcronym() const
10571057
QString QgsCoordinateReferenceSystem::toProj4() const
10581058
{
10591059
if ( !d->mIsValid )
1060-
return QLatin1String( "" );
1060+
return QString();
10611061

10621062
if ( d->mProj4.isEmpty() )
10631063
{
@@ -2363,7 +2363,7 @@ QString QgsCoordinateReferenceSystem::geographicCrsAuthId() const
23632363
}
23642364
else
23652365
{
2366-
return QLatin1String( "" );
2366+
return QString();
23672367
}
23682368
}
23692369

0 commit comments

Comments
 (0)