diff options
| author | 2026-02-21 13:38:02 +0800 | |
|---|---|---|
| committer | 2026-02-21 14:28:15 +0800 | |
| commit | 94482cb2c97aa215f83940643c5d4c0933727dcb (patch) | |
| tree | bee22fa113542abd1b863ee251fdcf0f9bd409b5 /objectstore/packed/idx_parse.go | |
| parent | diff: Add package-level doc comment (diff) | |
| signature | No signature | |
*: Modernize and lint; add CI v0.1.17
Diffstat (limited to 'objectstore/packed/idx_parse.go')
| -rw-r--r-- | objectstore/packed/idx_parse.go | 5 |
1 files changed, 1 insertions, 4 deletions
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) } |
