diff options
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) } |
