Fix formatting and comments in history_trienode.go

This commit is contained in:
rjl493456442 2026-01-30 10:05:28 +08:00 committed by GitHub
parent af14bfca24
commit f471ec9f8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -396,12 +396,12 @@ func decodeRestartTrailer(keySection []byte) ([]uint32, []uint32, int, error) {
return nil, nil, 0, fmt.Errorf("key section too short, size: %d", len(keySection))
}
nRestarts := binary.BigEndian.Uint32(keySection[len(keySection)-4:])
// Decode the trailer
var (
keyOffsets = make([]uint32, 0, int(nRestarts))
valOffsets = make([]uint32, 0, int(nRestarts))
)
// Decode the trailer
if len(keySection) < int(8*nRestarts)+4 {
return nil, nil, 0, fmt.Errorf("key section too short, restarts: %d, size: %d", nRestarts, len(keySection))
}