diff options
author | dan <dan@noemail.net> | 2016-05-12 17:06:04 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2016-05-12 17:06:04 +0000 |
commit | 82c0447701840cb933cad5b15243cd9c07d885a5 (patch) | |
tree | 0127d7e1b758fd6cdfe7406e3630481ac510b826 /src/pcache.c | |
parent | 91ef8ad42ceee04388ba471dfc8482ccaed91cc2 (diff) | |
download | sqlite-82c0447701840cb933cad5b15243cd9c07d885a5.tar.gz sqlite-82c0447701840cb933cad5b15243cd9c07d885a5.zip |
Add extra OPTIMIZATION-IF-FALSE comments where required to pcache.c.
FossilOrigin-Name: 9d55b8f541de43deb82d460d32005fd62f5430b2
Diffstat (limited to 'src/pcache.c')
-rw-r--r-- | src/pcache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pcache.c b/src/pcache.c index ee7914a44..f8fe90177 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -424,8 +424,11 @@ void SQLITE_NOINLINE sqlite3PcacheRelease(PgHdr *p){ if( (--p->nRef)==0 ){ if( p->flags&PGHDR_CLEAN ){ pcacheUnpin(p); - }else if( p->pDirtyPrev!=0 ){ - /* Move the page to the head of the dirty list. */ + }else if( p->pDirtyPrev!=0 ){ /*OPTIMIZATION-IF-FALSE*/ + /* Move the page to the head of the dirty list. If p->pDirtyPrev==0, + ** then page p is already at the head of the dirty list and the + ** following call would be a no-op. Hence the OPTIMIZATION-IF-FALSE + ** tag above. */ pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT); } } @@ -460,7 +463,7 @@ void sqlite3PcacheDrop(PgHdr *p){ */ void sqlite3PcacheMakeDirty(PgHdr *p){ assert( p->nRef>0 ); - if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){ + if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){ /*OPTIMIZATION-IF-FALSE*/ p->flags &= ~PGHDR_DONT_WRITE; if( p->flags & PGHDR_CLEAN ){ p->flags ^= (PGHDR_DIRTY|PGHDR_CLEAN); |