diff options
author | dan <dan@noemail.net> | 2016-05-12 09:48:23 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2016-05-12 09:48:23 +0000 |
commit | 613723d9fda58600335959dd38a31968e1323bd9 (patch) | |
tree | 73c493925709872c782e0003bba9ec62eddaefb2 /src/pcache.c | |
parent | 401907e3ff7616e85469752102c52f4bdaf7d73c (diff) | |
download | sqlite-613723d9fda58600335959dd38a31968e1323bd9.tar.gz sqlite-613723d9fda58600335959dd38a31968e1323bd9.zip |
Add a missing OPTIMIZATION-IF-FALSE comment to pcache.c.
FossilOrigin-Name: bc202e5b418d5a57bfc766883c4417c94829d96e
Diffstat (limited to 'src/pcache.c')
-rw-r--r-- | src/pcache.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pcache.c b/src/pcache.c index 4051bee00..8634a7918 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -124,7 +124,15 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ } } p->pDirty = pPage; - if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) ){ + + /* If pSynced is NULL and this page has a clear NEED_SYNC flag, set + ** pSynced to point to it. Checking the NEED_SYNC flag is an + ** optimization, as if pSynced points to a page with the NEED_SYNC + ** flag set sqlite3PcacheFetchStress() searches through all newer + ** entries of the dirty-list for a page with NEED_SYNC clear anyway. */ + if( !p->pSynced + && 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/ + ){ p->pSynced = pPage; } } |