Skip to content

Commit 1c53e08

Browse files
committed
db: vacuum if the db becomes empty
1 parent 2071723 commit 1c53e08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libpkg/pkgdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,7 +2396,7 @@ pkgdb_compact(struct pkgdb *db)
23962396
* used space.
23972397
*/
23982398

2399-
if (freelist_count / (float)page_count < 0.25)
2399+
if (freelist_count > 0 && freelist_count / (float)page_count < 0.25)
24002400
return (EPKG_OK);
24012401

24022402
return (sql_exec(db->sqlite, "VACUUM;"));

0 commit comments

Comments
 (0)