diff --git a/common/src/volumes/vol_grid_2d.rs b/common/src/volumes/vol_grid_2d.rs index ddb4167a18..ae5849fe41 100644 --- a/common/src/volumes/vol_grid_2d.rs +++ b/common/src/volumes/vol_grid_2d.rs @@ -56,6 +56,7 @@ impl ReadVol for VolGrid2d { // /// Call provided closure with each block in the supplied Aabb // /// Areas outside loaded chunks are ignored + #[inline(always)] fn for_each_in(&self, aabb: Aabb, mut f: impl FnMut(Vec3, Self::Vox)) where Self::Vox: Copy, @@ -151,7 +152,7 @@ impl VolGrid2d { } } - //#[inline] + #[inline(always)] pub fn chunk_size() -> Vec2 { V::RECT_SIZE } //#[inline] @@ -159,7 +160,7 @@ impl VolGrid2d { self.chunks.insert(key, chunk) } - //#[inline] + #[inline(always)] pub fn get_key(&self, key: Vec2) -> Option<&V> { self.chunks.get(&key).map(|arc_chunk| arc_chunk.as_ref()) } @@ -174,10 +175,10 @@ impl VolGrid2d { //#[inline] pub fn remove(&mut self, key: Vec2) -> Option> { self.chunks.remove(&key) } - //#[inline] + #[inline(always)] pub fn key_pos(&self, key: Vec2) -> Vec2 { key * V::RECT_SIZE.map(|e| e as i32) } - //#[inline] + #[inline(always)] pub fn pos_key(&self, pos: Vec3) -> Vec2 { Self::chunk_key(pos) } //#[inline]