Skip to content

Commit

Permalink
thread_local QRegularExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 27, 2023
1 parent 5231611 commit b1f4935
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/auth/basic/core/qgsauthbasicmethod.cpp
Expand Up @@ -172,7 +172,8 @@ bool QgsAuthBasicMethod::updateDataSourceUriItems( QStringList &connectionItems,
}
else if ( uri.startsWith( QLatin1String( "SDE:" ) ) )
{
uri = uri.replace( QRegularExpression( ",$" ), QStringLiteral( ",%1,%2" ).arg( username, password ) );
const thread_local QRegularExpression sRx = QRegularExpression( ",$" );
uri = uri.replace( sRx, QStringLiteral( ",%1,%2" ).arg( username, password ) );
}
else if ( uri.startsWith( QLatin1String( "IDB" ) ) )
{
Expand Down Expand Up @@ -210,7 +211,8 @@ bool QgsAuthBasicMethod::updateDataSourceUriItems( QStringList &connectionItems,
}
else if ( uri.startsWith( QLatin1String( "ODBC:" ) ) )
{
uri = uri.replace( QRegularExpression( "^ODBC:@?" ), "ODBC:" + username + '/' + password + '@' );
const thread_local QRegularExpression sOdbcRx = QRegularExpression( "^ODBC:@?" );
uri = uri.replace( sOdbcRx, "ODBC:" + username + '/' + password + '@' );
}
else if ( uri.startsWith( QLatin1String( "couchdb" ) )
|| uri.startsWith( QLatin1String( "DODS" ) )
Expand Down

0 comments on commit b1f4935

Please sign in to comment.