From a132b068bc446598c590f3cedf00e622047d6725 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 8 Dec 2022 13:59:42 +1100 Subject: [PATCH] Cleanup: use ELEM macro --- intern/ghost/intern/GHOST_SystemWayland.cpp | 2 +- source/blender/blenkernel/intern/pbvh_uv_islands.cc | 2 +- source/blender/editors/screen/screen_edit.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 4f6627310ca..0c292adb044 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -1244,7 +1244,7 @@ static void ghost_wl_display_report_error(struct wl_display *display) { int ecode = wl_display_get_error(display); GHOST_ASSERT(ecode, "Error not set!"); - if ((ecode == EPIPE || ecode == ECONNRESET)) { + if (ELEM(ecode, EPIPE, ECONNRESET)) { fprintf(stderr, "The Wayland connection broke. Did the Wayland compositor die?\n"); } else { diff --git a/source/blender/blenkernel/intern/pbvh_uv_islands.cc b/source/blender/blenkernel/intern/pbvh_uv_islands.cc index ac864d4d32d..aec4929c5fa 100644 --- a/source/blender/blenkernel/intern/pbvh_uv_islands.cc +++ b/source/blender/blenkernel/intern/pbvh_uv_islands.cc @@ -1185,7 +1185,7 @@ const UVVertex *UVPrimitive::get_other_uv_vertex(const UVVertex *v1, const UVVer for (const UVEdge *edge : edges) { for (const UVVertex *uv_vertex : edge->vertices) { - if (uv_vertex != v1 && uv_vertex != v2) { + if (!ELEM(uv_vertex, v1, v2)) { return uv_vertex; } } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 14ed5987cc7..71f71dd1a5c 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -382,7 +382,7 @@ static bool screen_areas_can_align(bScreen *screen, ScrArea *sa1, ScrArea *sa2, const short xmin = MIN2(sa1->v1->vec.x, sa2->v1->vec.x); const short xmax = MAX2(sa1->v3->vec.x, sa2->v3->vec.x); LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - if (area == sa1 || area == sa2) { + if (ELEM(area, sa1, sa2)) { continue; } if (area->v3->vec.x - area->v1->vec.x < tolerance && @@ -396,7 +396,7 @@ static bool screen_areas_can_align(bScreen *screen, ScrArea *sa1, ScrArea *sa2, const short ymin = MIN2(sa1->v1->vec.y, sa2->v1->vec.y); const short ymax = MAX2(sa1->v3->vec.y, sa2->v3->vec.y); LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - if (area == sa1 || area == sa2) { + if (ELEM(area, sa1, sa2)) { continue; } if (area->v3->vec.y - area->v1->vec.y < tolerance &&