aboutsummaryrefslogtreecommitdiff
path: root/pack_midx.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-16 00:00:00 +0000
committerGravatar Runxi Yu2025-11-16 00:00:00 +0000
commit9ac827977b8f430906110ecd2030324248fff604 (patch)
treeb0f8fdb46252bef429beb27190a2cfc0cbd42540 /pack_midx.go
parentREADME: Add my Villosa instance (diff)
signature
Support multiple hash sizes in one build
Diffstat (limited to 'pack_midx.go')
-rw-r--r--pack_midx.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack_midx.go b/pack_midx.go
index f37badbf..7f31e565 100644
--- a/pack_midx.go
+++ b/pack_midx.go
@@ -197,7 +197,7 @@ func (midx *multiPackIndex) parse(buf []byte) error {
if !ok {
return ErrInvalidObject
}
- oidlSize := int64(numObjects) * int64(HashSize)
+ oidlSize := int64(numObjects) * int64(midx.repo.HashSize)
if oidlOffset < 0 || oidlOffset+oidlSize > int64(len(buf)) {
return ErrInvalidObject
}
@@ -252,7 +252,7 @@ func (midx *multiPackIndex) lookup(id Hash) (packlocation, error) {
}
hi := int(readBE32(midx.fanout[first*4 : (first+1)*4]))
- idx, found := bsearchHash(midx.oids, HashSize, lo, hi, id)
+ idx, found := bsearchHash(midx.oids, midx.repo.HashSize, lo, hi, id)
if !found {
return packlocation{}, ErrNotFound
}