diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:30:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:32:54 +0300 |
commit | aa3a4973a30ff668a62447e18ac41f6c916b4a8b (patch) | |
tree | 1b24cc55995ba8b3d72aaabd9400a3e1e030d540 /source/blender/editors/curve/editcurve.c | |
parent | 7cb20d841da16d0bffb63154403267500e9941f5 (diff) |
Cleanup: use ELEM macro
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index d39c7eb0d95..4b7efe0f23c 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2055,7 +2055,7 @@ bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag) bp++; } - if (u == 0 || u == nu->pntsv - 1) { /* row in u-direction selected */ + if (ELEM(u, 0, nu->pntsv - 1)) { /* row in u-direction selected */ ok = true; newbp = (BPoint *)MEM_mallocN(nu->pntsu * (nu->pntsv + 1) * sizeof(BPoint), "extrudeNurb1"); @@ -2083,7 +2083,7 @@ bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag) nu->pntsv++; BKE_nurb_knot_calc_v(nu); } - else if (v == 0 || v == nu->pntsu - 1) { /* column in v-direction selected */ + else if (ELEM(v, 0, nu->pntsu - 1)) { /* column in v-direction selected */ ok = true; bpn = newbp = (BPoint *)MEM_mallocN((nu->pntsu + 1) * nu->pntsv * sizeof(BPoint), "extrudeNurb1"); @@ -2309,7 +2309,7 @@ static void adduplicateflagNurb( newv = 0; for (a = 0; a < nu->pntsu; a++) { if (usel[a]) { - if (newv == 0 || usel[a] == newv) { + if (ELEM(newv, 0, usel[a])) { newv = usel[a]; newu++; } @@ -3868,7 +3868,7 @@ static int set_spline_type_exec(bContext *C, wmOperator *op) const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); const int type = RNA_enum_get(op->ptr, "type"); - if (type == CU_CARDINAL || type == CU_BSPLINE) { + if (ELEM(type, CU_CARDINAL, CU_BSPLINE)) { BKE_report(op->reports, RPT_ERROR, "Not yet implemented"); continue; } @@ -4408,7 +4408,7 @@ static int merge_nurb(View3D *v3d, Object *obedit) /* resolution match, to avoid uv rotations */ if (nus1->nu->pntsv == 1) { - if (nus1->nu->pntsu == nus2->nu->pntsu || nus1->nu->pntsu == nus2->nu->pntsv) { + if (ELEM(nus1->nu->pntsu, nus2->nu->pntsu, nus2->nu->pntsv)) { /* pass */ } else { @@ -4416,7 +4416,7 @@ static int merge_nurb(View3D *v3d, Object *obedit) } } else if (nus2->nu->pntsv == 1) { - if (nus2->nu->pntsu == nus1->nu->pntsu || nus2->nu->pntsu == nus1->nu->pntsv) { + if (ELEM(nus2->nu->pntsu, nus1->nu->pntsu, nus1->nu->pntsv)) { /* pass */ } else { |