diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-20 02:45:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-20 03:16:43 +0300 |
commit | b280699078eee23bd8eb572668d6f0d8972d879a (patch) | |
tree | 8b6b8461938e71914d28e707137a8960f8a2d03c /source/blender/blenlib/intern/boxpack_2d.c | |
parent | ef9269bd62f31e39d39cc59cd34354b53eae6661 (diff) |
Cleanup: use elem macros
Diffstat (limited to 'source/blender/blenlib/intern/boxpack_2d.c')
-rw-r--r-- | source/blender/blenlib/intern/boxpack_2d.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c index 4a07f1134d0..cf5831cada5 100644 --- a/source/blender/blenlib/intern/boxpack_2d.c +++ b/source/blender/blenlib/intern/boxpack_2d.c @@ -516,7 +516,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r * flag verts on one or both of the boxes * as being used by checking the width or * height of both boxes */ - if (vert->tlb && vert->trb && (box == vert->tlb || box == vert->trb)) { + if (vert->tlb && vert->trb && (ELEM(box, vert->tlb, vert->trb))) { if (UNLIKELY(fabsf(vert->tlb->h - vert->trb->h) < EPSILON_MERGE)) { #ifdef USE_MERGE # define A (vert->trb->v[TL]) @@ -547,7 +547,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r vert->tlb->v[TR]->free &= ~(TRF | BRF); } } - else if (vert->blb && vert->brb && (box == vert->blb || box == vert->brb)) { + else if (vert->blb && vert->brb && (ELEM(box, vert->blb, vert->brb))) { if (UNLIKELY(fabsf(vert->blb->h - vert->brb->h) < EPSILON_MERGE)) { #ifdef USE_MERGE # define A (vert->blb->v[BR]) @@ -579,7 +579,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r } } /* Horizontal */ - if (vert->tlb && vert->blb && (box == vert->tlb || box == vert->blb)) { + if (vert->tlb && vert->blb && (ELEM(box, vert->tlb, vert->blb))) { if (UNLIKELY(fabsf(vert->tlb->w - vert->blb->w) < EPSILON_MERGE)) { #ifdef USE_MERGE # define A (vert->blb->v[TL]) @@ -610,7 +610,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r vert->tlb->v[BL]->free &= ~(BLF | BRF); } } - else if (vert->trb && vert->brb && (box == vert->trb || box == vert->brb)) { + else if (vert->trb && vert->brb && (ELEM(box, vert->trb, vert->brb))) { if (UNLIKELY(fabsf(vert->trb->w - vert->brb->w) < EPSILON_MERGE)) { #ifdef USE_MERGE |