Skip to content
Permalink
Browse files

Improve chances for copy elision

  • Loading branch information
m-kuhn committed Nov 15, 2017
1 parent 2b6d1f8 commit 447cd18a27ea4791d02a885d0063b8e730a28ac9
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/core/qgsauxiliarystorage.cpp
@@ -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;
}

0 comments on commit 447cd18

Please sign in to comment.
You can’t perform that action at this time.