diff options
Diffstat (limited to 'src/disk/block.rs')
-rw-r--r-- | src/disk/block.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/disk/block.rs b/src/disk/block.rs index be3d85a..26a7ec5 100644 --- a/src/disk/block.rs +++ b/src/disk/block.rs @@ -120,10 +120,12 @@ impl DirectoryBlock { } pub(crate) fn query(&self, mut index: usize) -> bool { - if index < 7 { // 0-6, first u8 + if index < 7 { + // 0-6, first u8 index = index + 1; self.occupancy[0] & (1 << (7 - index)) as u8 != 0 - } else if index < 15 { // 7-14, second u8 + } else if index < 15 { + // 7-14, second u8 index = index - 7; self.occupancy[1] & (1 << (7 - index)) as u8 != 0 } else { @@ -149,7 +151,8 @@ impl DirectoryBlock { if index < 7 { index = index + 1; self.occupancy[0] &= !((1 << (7 - index)) as u8); - } else if index < 15 { // 7-14, second u8 + } else if index < 15 { + // 7-14, second u8 index = index - 7; self.occupancy[1] &= !((1 << (7 - index)) as u8); } |