diff options
author | drh <drh@noemail.net> | 2011-04-05 19:26:30 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-04-05 19:26:30 +0000 |
commit | d3ef5ae05f75fd070be6480e47d45645b8f3d135 (patch) | |
tree | 1503ebaf6809cd7b2d4b9e401f45e1eaf0d12b1b /src | |
parent | 8d4991e7ba4e79fabcb3e0f4f6919b9d25d95401 (diff) | |
download | sqlite-d3ef5ae05f75fd070be6480e47d45645b8f3d135.tar.gz sqlite-d3ef5ae05f75fd070be6480e47d45645b8f3d135.zip |
Simplifications to the sqlite3ResetInternalSchema() logic to eliminate
unreachable branches.
FossilOrigin-Name: a4c3ac989d4e93f0279172901b9ece822d137700
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/build.c b/src/build.c index 7e73b6a8e..e45697b9f 100644 --- a/src/build.c +++ b/src/build.c @@ -414,14 +414,16 @@ void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){ /* Case 1: Reset the single schema identified by iDb */ Db *pDb = &db->aDb[iDb]; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); - if( ALWAYS(pDb->pSchema) ){ - sqlite3SchemaClear(pDb->pSchema); - } + assert( pDb->pSchema!=0 ); + sqlite3SchemaClear(pDb->pSchema); + /* If any database other than TEMP is reset, then also reset TEMP ** since TEMP might be holding triggers that reference tables in the ** other database. */ - if( iDb!=1 && (pDb = &db->aDb[1])!=0 && ALWAYS(pDb->pSchema) ){ + if( iDb!=1 ){ + pDb = &db->aDb[1]; + assert( pDb->pSchema!=0 ); sqlite3SchemaClear(pDb->pSchema); } return; |