diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-04 06:02:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-04 09:38:11 +0300 |
commit | a5081896bc0416f9b64ae8e488bfe1cc2042ca7e (patch) | |
tree | 3d5a1c29a845adef18d05b623eeee5f9aacefae9 /source/blender/editors/gpencil/gpencil_fill.c | |
parent | b5c2a75d26dbd5725ee5c8f361db35aedb45efdf (diff) |
Cleanup: redundant code, minor inconsistencies
- Remove ternary operators when both values are the same.
- Remove break after return.
- Remove redundant NULL checks for code which handles
those cases immediately beforehand.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_fill.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 1059e37704a..622556943c9 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -722,9 +722,7 @@ static void gpencil_boundaryfill_area(tGPDfill *tgpf) } /* release ibuf */ - if (ibuf) { - BKE_image_release_ibuf(tgpf->ima, ibuf, lock); - } + BKE_image_release_ibuf(tgpf->ima, ibuf, lock); tgpf->ima->id.tag |= LIB_TAG_DOIT; /* free temp stack data */ @@ -760,9 +758,7 @@ static void gpencil_set_borders(tGPDfill *tgpf, const bool transparent) } /* release ibuf */ - if (ibuf) { - BKE_image_release_ibuf(tgpf->ima, ibuf, lock); - } + BKE_image_release_ibuf(tgpf->ima, ibuf, lock); tgpf->ima->id.tag |= LIB_TAG_DOIT; } @@ -794,9 +790,7 @@ static void gpencil_invert_image(tGPDfill *tgpf) } /* release ibuf */ - if (ibuf) { - BKE_image_release_ibuf(tgpf->ima, ibuf, lock); - } + BKE_image_release_ibuf(tgpf->ima, ibuf, lock); tgpf->ima->id.tag |= LIB_TAG_DOIT; } @@ -846,9 +840,7 @@ static void gpencil_erase_processed_area(tGPDfill *tgpf) } /* release ibuf */ - if (ibuf) { - BKE_image_release_ibuf(tgpf->ima, ibuf, lock); - } + BKE_image_release_ibuf(tgpf->ima, ibuf, lock); tgpf->ima->id.tag |= LIB_TAG_DOIT; } @@ -1062,9 +1054,7 @@ static void gpencil_get_outline_points(tGPDfill *tgpf, const bool dilate) } /* release ibuf */ - if (ibuf) { - BKE_image_release_ibuf(tgpf->ima, ibuf, lock); - } + BKE_image_release_ibuf(tgpf->ima, ibuf, lock); } /* get z-depth array to reproject on surface */ |