1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Put an ALWAYS() around a condition in pcache.c that must always be true in

the current implementation.

FossilOrigin-Name: 88810cd091b33f2c56f842e32cafbac5d34d7412
This commit is contained in:
drh
2010-03-19 19:23:51 +00:00
parent 3f0d9d3846
commit f3609eeba7
3 changed files with 24 additions and 9 deletions

View File

@@ -407,7 +407,12 @@ void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
PgHdr *pNext;
for(p=pCache->pDirty; p; p=pNext){
pNext = p->pDirtyNext;
if( p->pgno>pgno ){
/* This routine never gets call with a positive pgno except right
** after sqlite3PcacheCleanAll(). So if there are dirty pages,
** it must be that pgno==0.
*/
assert( p->pgno>0 );
if( ALWAYS(p->pgno>pgno) ){
assert( p->flags&PGHDR_DIRTY );
sqlite3PcacheMakeClean(p);
}