From 94482cb2c97aa215f83940643c5d4c0933727dcb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 13:38:02 +0800 Subject: *: Modernize and lint; add CI --- objectstore/packed/idx_parse.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'objectstore/packed/idx_parse.go') diff --git a/objectstore/packed/idx_parse.go b/objectstore/packed/idx_parse.go index a6adc721..0af72594 100644 --- a/objectstore/packed/idx_parse.go +++ b/objectstore/packed/idx_parse.go @@ -62,10 +62,7 @@ func (index *idxFile) parse() error { return fmt.Errorf("objectstore/packed: idx %q has malformed 64-bit offset table", index.idxName) } index.offset64Count = offset64Bytes / 8 - maxOffset64Count := index.numObjects - 1 - if maxOffset64Count < 0 { - maxOffset64Count = 0 - } + maxOffset64Count := max(index.numObjects-1, 0) if index.offset64Count > maxOffset64Count { return fmt.Errorf("objectstore/packed: idx %q has oversized 64-bit offset table", index.idxName) } -- cgit v1.3.1-10-gc9f91