Cleanup: use ELEM macro
This commit is contained in:
parent
a0dc062816
commit
a132b068bc
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user