Skip to content

Commit

Permalink
Improve chances for copy elision
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 15, 2017
1 parent 2b6d1f8 commit 447cd18
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/core/qgsauxiliarystorage.cpp
Expand Up @@ -683,20 +683,17 @@ bool QgsAuxiliaryStorage::createTable( const QString &type, const QString &table

spatialite_database_unique_ptr QgsAuxiliaryStorage::createDB( const QString &filename )
{
int rc;

// open/create database
spatialite_database_unique_ptr database;

int rc;
rc = database.open_v2( filename, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr );
if ( rc )
{
debugMsg( QStringLiteral( "sqlite3_open_v2" ), database.get() );
return database;
}

// activating Foreign Key constraints
if ( !exec( QStringLiteral( "PRAGMA foreign_keys = 1" ), database.get() ) )
return database;
else
// activating Foreign Key constraints
exec( QStringLiteral( "PRAGMA foreign_keys = 1" ), database.get() );

return database;
}
Expand Down

0 comments on commit 447cd18

Please sign in to comment.