From 21462565632b876ac4eadf2bd30573f2fda70c76 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 9 Mar 2022 09:35:37 +1100 Subject: Cleanup: use ELEM macro --- source/blender/blenkernel/intern/fluid.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/fluid.c') diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 6f2760e91a6..f85361e94ff 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1845,8 +1845,8 @@ static void sample_mesh(FluidFlowSettings *ffs, const float surface_distance = 1.732; nearest.dist_sq = surface_distance * surface_distance; /* find_nearest uses squared distance. */ - bool is_gas_flow = (ffs->type == FLUID_FLOW_TYPE_SMOKE || ffs->type == FLUID_FLOW_TYPE_FIRE || - ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE); + bool is_gas_flow = ELEM( + ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_FIRE, FLUID_FLOW_TYPE_SMOKEFIRE); /* Emission strength for gases will be computed below. * For liquids it's not needed. Just set to non zero value @@ -2035,8 +2035,7 @@ static void emit_from_mesh_task_cb(void *__restrict userdata, /* Compute emission only for flow objects that produce fluid (i.e. skip outflow objects). * Result in bb->influence. Also computes initial velocities. Result in bb->velocity. */ - if ((data->ffs->behavior == FLUID_FLOW_BEHAVIOR_GEOMETRY) || - (data->ffs->behavior == FLUID_FLOW_BEHAVIOR_INFLOW)) { + if (ELEM(data->ffs->behavior, FLUID_FLOW_BEHAVIOR_GEOMETRY, FLUID_FLOW_BEHAVIOR_INFLOW)) { sample_mesh(data->ffs, data->mvert, data->vert_normals, @@ -2697,8 +2696,8 @@ static bool escape_flowsobject(Object *flowobj, bool is_static = is_static_object(flowobj); bool liquid_flow = ffs->type == FLUID_FLOW_TYPE_LIQUID; - bool gas_flow = (ffs->type == FLUID_FLOW_TYPE_SMOKE || ffs->type == FLUID_FLOW_TYPE_FIRE || - ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE); + bool gas_flow = ELEM( + ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_FIRE, FLUID_FLOW_TYPE_SMOKEFIRE); bool is_geometry = (ffs->behavior == FLUID_FLOW_BEHAVIOR_GEOMETRY); bool liquid_domain = fds->type == FLUID_DOMAIN_TYPE_LIQUID; -- cgit v1.2.3