diff --git a/common/src/terrain/chonk.rs b/common/src/terrain/chonk.rs index 3ec18617e7..94f3a3f501 100644 --- a/common/src/terrain/chonk.rs +++ b/common/src/terrain/chonk.rs @@ -57,8 +57,10 @@ impl Chonk { pub fn meta(&self) -> &M { &self.meta } + #[inline] pub fn get_min_z(&self) -> i32 { self.z_offset } + #[inline] pub fn get_max_z(&self) -> i32 { self.z_offset + (self.sub_chunks.len() as u32 * SubChunkSize::::SIZE.z) as i32 } @@ -71,6 +73,7 @@ impl Chonk { // Returns the index (in self.sub_chunks) of the SubChunk that contains // layer z; note that this index changes when more SubChunks are prepended + #[inline] fn sub_chunk_idx(&self, z: i32) -> i32 { let diff = z - self.z_offset; diff >> (SubChunkSize::::SIZE.z - 1).count_ones() @@ -166,7 +169,7 @@ impl ReadVol for Chonk { /// Call provided closure with each block in the supplied Aabb /// Portions of the Aabb outside this chonk are ignored - //#[inline] + #[inline] fn for_each_in(&self, aabb: Aabb, mut f: impl FnMut(Vec3, V)) where V: Copy,