Cleanup: use the ELEM macro

This commit is contained in:
Campbell Barton 2022-01-07 15:30:14 +11:00
parent 82858ca3f4
commit 1642028310
4 changed files with 8 additions and 7 deletions

View File

@ -1118,7 +1118,7 @@ static void subdiv_mesh_vertex_of_loose_edge(const struct SubdivForeachContext *
find_edge_neighbors(ctx, coarse_edge, neighbors);
/* Interpolate custom data when not an end point.
* This data has already been copied from the original vertex by #subdiv_mesh_vertex_loose. */
if (u != 0.0 && u != 1.0) {
if (!ELEM(u, 0.0, 1.0)) {
subdiv_mesh_vertex_of_loose_edge_interpolate(ctx, coarse_edge, u, subdiv_vertex_index);
}
/* Interpolate coordinate. */

View File

@ -258,10 +258,11 @@ static GPUShader *get_patch_evaluation_shader(int shader_type)
static GPUShader *get_subdiv_shader(int shader_type, const char *defines)
{
if (shader_type == SHADER_PATCH_EVALUATION ||
shader_type == SHADER_PATCH_EVALUATION_LIMIT_NORMALS ||
shader_type == SHADER_PATCH_EVALUATION_FVAR ||
shader_type == SHADER_PATCH_EVALUATION_FACE_DOTS) {
if (ELEM(shader_type,
SHADER_PATCH_EVALUATION,
SHADER_PATCH_EVALUATION_LIMIT_NORMALS,
SHADER_PATCH_EVALUATION_FVAR,
SHADER_PATCH_EVALUATION_FACE_DOTS)) {
return get_patch_evaluation_shader(shader_type);
}
if (g_subdiv_shaders[shader_type] == nullptr) {

View File

@ -620,7 +620,7 @@ AbcUvScope get_uv_scope(const Alembic::AbcGeom::GeometryScope scope,
/* kVaryingScope is sometimes used for vertex scopes as the values vary across the vertices. To
* be sure, one has to check the size of the data against the number of vertices, as it could
* also be a varying attribute across the faces (i.e. one value per face). */
if ((scope == kVaryingScope || scope == kVertexScope) && indices->size() == config.totvert) {
if ((ELEM(scope, kVaryingScope, kVertexScope)) && indices->size() == config.totvert) {
return ABC_UV_SCOPE_VERTEX;
}

View File

@ -956,7 +956,7 @@ static int wm_xr_navigation_fly_modal(bContext *C, wmOperator *op, const wmEvent
const double time_now = PIL_check_seconds_timer();
mode = (eXrFlyMode)RNA_enum_get(op->ptr, "mode");
turn = (mode == XR_FLY_TURNLEFT || mode == XR_FLY_TURNRIGHT);
turn = (ELEM(mode, XR_FLY_TURNLEFT, XR_FLY_TURNRIGHT));
locz_lock = RNA_boolean_get(op->ptr, "lock_location_z");
dir_lock = RNA_boolean_get(op->ptr, "lock_direction");