aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-28 02:10:05 +0000
committermat <git@matdoes.dev>2024-12-28 02:10:05 +0000
commit615d8f9d2ac56b3244d328587243301da253eafd (patch)
tree3cf08428ddeb29bcb58dbce04fee7bbbe4d2814d /azalea-world/src
parentebaf5128fbc87970b2ba1f6157e5da035ae379c8 (diff)
downloadazalea-drasl-615d8f9d2ac56b3244d328587243301da253eafd.tar.xz
bump minimum rust version and improve pathfinder docs
Diffstat (limited to 'azalea-world/src')
-rwxr-xr-xazalea-world/src/bit_storage.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-world/src/bit_storage.rs b/azalea-world/src/bit_storage.rs
index cf3ee7e4..5d92f795 100755
--- a/azalea-world/src/bit_storage.rs
+++ b/azalea-world/src/bit_storage.rs
@@ -176,7 +176,7 @@ impl BitStorage {
let cell_index = self.cell_index(index as u64);
let cell = &self.data[cell_index];
let bit_index = (index - cell_index * self.values_per_long) * self.bits;
- cell >> bit_index & self.mask
+ (cell >> bit_index) & self.mask
}
pub fn get_and_set(&mut self, index: usize, value: u64) -> u64 {
@@ -190,8 +190,8 @@ impl BitStorage {
let cell_index = self.cell_index(index as u64);
let cell = &mut self.data[cell_index];
let bit_index = (index - cell_index * self.values_per_long) * self.bits;
- let old_value = *cell >> (bit_index as u64) & self.mask;
- *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index;
+ let old_value = (*cell >> (bit_index as u64)) & self.mask;
+ *cell = (*cell & !(self.mask << bit_index)) | ((value & self.mask) << bit_index);
old_value
}
@@ -206,7 +206,7 @@ impl BitStorage {
let cell_index = self.cell_index(index as u64);
let cell = &mut self.data[cell_index];
let bit_index = (index - cell_index * self.values_per_long) * self.bits;
- *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index;
+ *cell = (*cell & !(self.mask << bit_index)) | ((value & self.mask) << bit_index);
}
/// The number of entries.