Skip to content

Commit 1f59353

Browse files
committed
fix(mft): optimize entry size calculation in MftRecordIter
1 parent a300d2f commit 1f59353

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/mft/mft_record_iter.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ impl Iterator for MftRecordIter {
3434
if self.index >= self.total {
3535
return None;
3636
}
37-
let start = self.index * self.entry_size;
38-
let end = start + self.entry_size;
37+
let entry_size_bytes = self.entry_size.get::<byte>();
38+
let start = self.index * entry_size_bytes;
39+
let end = start + entry_size_bytes;
3940
self.index += 1;
4041
Some(MftRecord::from_bytes_unchecked(
41-
self.bytes.slice(start.get::<byte>()..end.get::<byte>()),
42+
self.bytes.slice(start..end),
4243
))
4344
}
4445

0 commit comments

Comments
 (0)