From b251368b0984f36491c1ad322a2cff7d4f587c53 Mon Sep 17 00:00:00 2001 From: jdl Date: Mon, 4 Dec 2023 20:25:37 +0100 Subject: [PATCH] Cleanup, no logic changes. --- mdb/pfile/index.go | 4 ++-- mdb/pfile/pagefile.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mdb/pfile/index.go b/mdb/pfile/index.go index 6d6898e..0ecb374 100644 --- a/mdb/pfile/index.go +++ b/mdb/pfile/index.go @@ -13,13 +13,13 @@ type Index struct { } func NewIndex(f *File) (*Index, error) { - maxPage, err := f.maxPage() + firstPage, err := f.pageCount() if err != nil { return nil, err } idx := &Index{ - fList: newFreeList(maxPage), + fList: newFreeList(firstPage), aList: *newAllocList(), seen: map[[2]uint64]struct{}{}, mask: []bool{}, diff --git a/mdb/pfile/pagefile.go b/mdb/pfile/pagefile.go index 193f953..52e3328 100644 --- a/mdb/pfile/pagefile.go +++ b/mdb/pfile/pagefile.go @@ -134,7 +134,7 @@ func (pf *File) writePage(page dataPage, id uint64) error { // Reading // ---------------------------------------------------------------------------- -func (pf *File) maxPage() (uint64, error) { +func (pf *File) pageCount() (uint64, error) { fi, err := pf.f.Stat() if err != nil { return 0, errs.IO.WithErr(err)