diff options
| author | mat <git@matdoes.dev> | 2023-10-04 20:24:49 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-04 20:24:49 -0500 |
| commit | 17734cdcbf8ea30ded09a0b14372d92c11d1cc8c (patch) | |
| tree | bd3ea629493015f3d1703f50c932da4b96b47b68 /azalea-core/src/bitset.rs | |
| parent | c2fb99159556e1d55552aac0a782dbc69be338f3 (diff) | |
| download | azalea-drasl-17734cdcbf8ea30ded09a0b14372d92c11d1cc8c.tar.xz | |
add safety comments and simplify some code
Diffstat (limited to 'azalea-core/src/bitset.rs')
| -rwxr-xr-x | azalea-core/src/bitset.rs | 2 |
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); } |
