aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/bitset.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-10-04 20:24:49 -0500
committermat <git@matdoes.dev>2023-10-04 20:24:49 -0500
commit17734cdcbf8ea30ded09a0b14372d92c11d1cc8c (patch)
treebd3ea629493015f3d1703f50c932da4b96b47b68 /azalea-core/src/bitset.rs
parentc2fb99159556e1d55552aac0a782dbc69be338f3 (diff)
downloadazalea-drasl-17734cdcbf8ea30ded09a0b14372d92c11d1cc8c.tar.xz
add safety comments and simplify some code
Diffstat (limited to 'azalea-core/src/bitset.rs')
-rwxr-xr-xazalea-core/src/bitset.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs
index b7a426c9..912216a8 100755
--- a/azalea-core/src/bitset.rs
+++ b/azalea-core/src/bitset.rs
@@ -143,10 +143,12 @@ where
}
}
+ #[inline]
pub fn index(&self, index: usize) -> bool {
(self.data[index / 8] & (1u8 << (index % 8))) != 0
}
+ #[inline]
pub fn set(&mut self, bit_index: usize) {
self.data[bit_index / 8] |= 1u8 << (bit_index % 8);
}