Commit: a132b068bc446598c590f3cedf00e622047d6725
Author: Campbell Barton
Date:   Thu Dec 8 13:59:42 2022 +1100
Branches: master
https://developer.blender.org/rBa132b068bc446598c590f3cedf00e622047d6725

Cleanup: use ELEM macro

===================================================================

M       intern/ghost/intern/GHOST_SystemWayland.cpp
M       source/blender/blenkernel/intern/pbvh_uv_islands.cc
M       source/blender/editors/screen/screen_edit.c

===================================================================

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 &&

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to