aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-19 15:05:44 +0600
committermat <git@matdoes.dev>2026-01-19 13:28:15 +0400
commit6f82263de58c6f33cca8cc36276b5e478801b352 (patch)
tree6230d62ce601efa2ae31f9fb363e8d756d787d4d /azalea-core/src
parent70bd9c94dd7ca68777a0ead5f9432812e535bee3 (diff)
downloadazalea-drasl-6f82263de58c6f33cca8cc36276b5e478801b352.tar.xz
minor physics optimizations
Diffstat (limited to 'azalea-core/src')
-rw-r--r--azalea-core/src/bitset.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs
index f8c9da28..b50988b1 100644
--- a/azalea-core/src/bitset.rs
+++ b/azalea-core/src/bitset.rs
@@ -8,7 +8,7 @@ use azalea_buf::{AzBuf, BufReadError};
/// Represents Java's BitSet, a list of bits.
#[derive(AzBuf, Clone, Debug, Default, Eq, Hash, PartialEq)]
pub struct BitSet {
- data: Vec<u64>,
+ data: Box<[u64]>,
}
/// `log2(64)`.
@@ -19,7 +19,7 @@ impl BitSet {
#[inline]
pub fn new(num_bits: usize) -> Self {
BitSet {
- data: vec![0; num_bits.div_ceil(64)],
+ data: vec![0; num_bits.div_ceil(64)].into(),
}
}
@@ -155,7 +155,7 @@ impl BitSet {
impl From<Vec<u64>> for BitSet {
fn from(data: Vec<u64>) -> Self {
- BitSet { data }
+ BitSet { data: data.into() }
}
}
@@ -165,7 +165,7 @@ impl From<Vec<u8>> for BitSet {
for (i, byte) in data.iter().enumerate() {
words[i / 8] |= (*byte as u64) << ((i % 8) * 8);
}
- BitSet { data: words }
+ BitSet { data: words.into() }
}
}