Skip to content

Commit

Permalink
Regex as cons thread_local
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Aug 17, 2021
1 parent 75a4f28 commit d94bcbc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/providers/memory/qgsmemoryprovider.cpp
Expand Up @@ -113,13 +113,13 @@ QgsMemoryProvider::QgsMemoryProvider( const QString &uri, const ProviderOptions
if ( query.hasQueryItem( QStringLiteral( "field" ) ) )
{
QList<QgsField> attributes;
QRegularExpression reFieldDef( "\\:"
"([\\w\\s]+)" // type
"(?:\\((\\-?\\d+)" // length
"(?:\\,(\\-?\\d+))?" // precision
"\\))?(\\[\\])?" // array
"$",
QRegularExpression::CaseInsensitiveOption );
const thread_local QRegularExpression reFieldDef( "\\:"
"([\\w\\s]+)" // type
"(?:\\((\\-?\\d+)" // length
"(?:\\,(\\-?\\d+))?" // precision
"\\))?(\\[\\])?" // array
"$",
QRegularExpression::CaseInsensitiveOption );
QStringList fields = query.allQueryItemValues( QStringLiteral( "field" ) );
for ( int i = 0; i < fields.size(); i++ )
{
Expand Down

0 comments on commit d94bcbc

Please sign in to comment.