From 9d1368b0ea380a9446b4697af668d1685464b6c7 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Sun, 26 Nov 2023 02:33:01 -0800 Subject: more code idk what they are im so tired ohno --- src/disk/block.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/disk/block.rs') 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); } -- cgit v1.2.3-70-g09d2