Assert acount hash mmap file capacity > 0 (#33575)
assert mmap capacity > 0 Co-authored-by: HaoranYi <haoran.yi@solana.com>
This commit is contained in:
parent
46cf79a9c4
commit
72574dac02
|
@ -97,6 +97,7 @@ impl AccountHashesFile {
|
|||
// Theoretical performance optimization: write a zero to the end of
|
||||
// the file so that we won't have to resize it later, which may be
|
||||
// expensive.
|
||||
assert!(self.capacity > 0);
|
||||
data.seek(SeekFrom::Start((self.capacity - 1) as u64))
|
||||
.unwrap();
|
||||
data.write_all(&[0]).unwrap();
|
||||
|
|
Loading…
Reference in New Issue