From f65399eb002463ed6a9c4221d08d4d0f3394a552 Mon Sep 17 00:00:00 2001 From: Imbris Date: Fri, 8 Oct 2021 11:53:40 -0400 Subject: [PATCH] Make LiquidKind::merge as inlineable, remove always from TerrainGrid::for_each_in inline annotation --- common/src/comp/fluid_dynamics.rs | 1 + common/src/volumes/vol_grid_2d.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/comp/fluid_dynamics.rs b/common/src/comp/fluid_dynamics.rs index 209ccfb79d..1607cb5f2c 100644 --- a/common/src/comp/fluid_dynamics.rs +++ b/common/src/comp/fluid_dynamics.rs @@ -19,6 +19,7 @@ impl LiquidKind { /// If an entity is in multiple overlapping liquid blocks, which one takes /// precedence? (should be a rare edge case, since checkerboard patterns of /// water and lava shouldn't show up in worldgen) + #[inline] pub fn merge(self, other: LiquidKind) -> LiquidKind { use LiquidKind::{Lava, Water}; match (self, other) { diff --git a/common/src/volumes/vol_grid_2d.rs b/common/src/volumes/vol_grid_2d.rs index ae5849fe41..b6fac1630f 100644 --- a/common/src/volumes/vol_grid_2d.rs +++ b/common/src/volumes/vol_grid_2d.rs @@ -56,7 +56,7 @@ impl ReadVol for VolGrid2d { // /// Call provided closure with each block in the supplied Aabb // /// Areas outside loaded chunks are ignored - #[inline(always)] + #[inline] fn for_each_in(&self, aabb: Aabb, mut f: impl FnMut(Vec3, Self::Vox)) where Self::Vox: Copy,