mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
sqlite3PCachePerecentDirty() should return 0 if the pcache is empty.
FossilOrigin-Name: 85f3d80eb7319754792eef76996b2c740a2b0073
This commit is contained in:
@@ -695,7 +695,7 @@ int sqlite3PCachePercentDirty(PCache *pCache){
|
||||
int nDirty = 0;
|
||||
int nCache = numberOfCachePages(pCache);
|
||||
for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++;
|
||||
return (int)(((i64)nDirty * 100) / nCache);
|
||||
return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
|
||||
}
|
||||
|
||||
#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)
|
||||
|
||||
Reference in New Issue
Block a user