From 6f82263de58c6f33cca8cc36276b5e478801b352 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 19 Jan 2026 15:05:44 +0600 Subject: minor physics optimizations --- azalea-core/src/bitset.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea-core/src') 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, + 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> for BitSet { fn from(data: Vec) -> Self { - BitSet { data } + BitSet { data: data.into() } } } @@ -165,7 +165,7 @@ impl From> 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() } } } -- cgit v1.2.3