Cleanup: use the ELEM macro

This commit is contained in:
Campbell Barton 2023-01-03 11:14:55 +11:00
parent e39ca9d1e3
commit fd068e92f1
4 changed files with 5 additions and 5 deletions

View File

@ -972,7 +972,7 @@ static void loop_manifold_fan_around_vert_next(const Span<MLoop> loops,
const uint vert_fan_next = loops[*r_mlfan_curr_index].v;
const MPoly &mpfan_next = polys[*r_mpfan_curr_index];
if ((vert_fan_orig == vert_fan_next && vert_fan_orig == mv_pivot_index) ||
(vert_fan_orig != vert_fan_next && vert_fan_orig != mv_pivot_index)) {
(!ELEM(vert_fan_orig, vert_fan_next, mv_pivot_index))) {
/* We need the previous loop, but current one is our vertex's loop. */
*r_mlfan_vert_index = *r_mlfan_curr_index;
if (--(*r_mlfan_curr_index) < mpfan_next.loopstart) {

View File

@ -36,7 +36,7 @@ MeshUVVert *MeshPrimitive::get_other_uv_vertex(const MeshVertex *v1, const MeshV
BLI_assert(vertices[0].vertex == v1 || vertices[1].vertex == v1 || vertices[2].vertex == v1);
BLI_assert(vertices[0].vertex == v2 || vertices[1].vertex == v2 || vertices[2].vertex == v2);
for (MeshUVVert &uv_vertex : vertices) {
if (uv_vertex.vertex != v1 && uv_vertex.vertex != v2) {
if (!ELEM(uv_vertex.vertex, v1, v2)) {
return &uv_vertex;
}
}

View File

@ -263,7 +263,7 @@ static bool clip_uv_transform_shear(const TransInfo *t, float *vec, float *vec_i
for (int i = 0; i < max_i; i++) {
/* Binary search. */
const float value_mid = (value_inside_bounds + value) / 2.0f;
if (value_mid == value_inside_bounds || value_mid == value) {
if (ELEM(value_mid, value_inside_bounds, value)) {
break; /* float precision reached. */
}
if (uv_shear_in_clip_bounds_test(t, value_mid)) {

View File

@ -372,7 +372,7 @@ static void custom_range_header_draw(const bContext *UNUSED(C), Panel *panel)
int mode = RNA_enum_get(ptr, "mode");
uiLayoutSetActive(layout, (mode != GP_TIME_MODE_FIX && mode != GP_TIME_MODE_CHAIN));
uiLayoutSetActive(layout, !ELEM(mode, GP_TIME_MODE_FIX, GP_TIME_MODE_CHAIN));
uiItemR(layout, ptr, "use_custom_frame_range", 0, NULL, ICON_NONE);
}
@ -388,7 +388,7 @@ static void custom_range_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayoutSetPropSep(layout, true);
uiLayoutSetActive(layout,
(mode != GP_TIME_MODE_FIX && mode != GP_TIME_MODE_CHAIN) &&
(!ELEM(mode, GP_TIME_MODE_FIX, GP_TIME_MODE_CHAIN)) &&
RNA_boolean_get(ptr, "use_custom_frame_range"));
col = uiLayoutColumn(layout, true);