diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:39:50 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:06 +0300 |
commit | dbf4f52fe0b7644ab607a6edd66facc6f1736693 (patch) | |
tree | 51d003842c620ddeb7258ebd863fd60eed972e7d /source/blender/imbuf/intern/openexr/openexr_api.cpp | |
parent | c889d93c80c52603a501b6b76f6e251b7a6112d2 (diff) |
Cleanup: ImBuf, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/imbuf` module.
No functional changes.
Diffstat (limited to 'source/blender/imbuf/intern/openexr/openexr_api.cpp')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index a781c616b1c..05592a7d408 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -131,9 +131,8 @@ class IMemStream : public Imf::IStream { _exrpos += n; return true; } - else { - return false; - } + + return false; } virtual Int64 tellg() @@ -597,15 +596,13 @@ int imb_save_openexr(struct ImBuf *ibuf, const char *name, int flags) if (ibuf->foptions.flag & OPENEXR_HALF) { return (int)imb_save_openexr_half(ibuf, name, flags); } - else { - /* when no float rect, we save as half (16 bits is sufficient) */ - if (ibuf->rect_float == NULL) { - return (int)imb_save_openexr_half(ibuf, name, flags); - } - else { - return (int)imb_save_openexr_float(ibuf, name, flags); - } + + /* when no float rect, we save as half (16 bits is sufficient) */ + if (ibuf->rect_float == NULL) { + return (int)imb_save_openexr_half(ibuf, name, flags); } + + return (int)imb_save_openexr_float(ibuf, name, flags); } /* ******* Nicer API, MultiLayer and with Tile file support ************************************ */ @@ -719,9 +716,8 @@ static int imb_exr_get_multiView_id(StringVector &views, const std::string &name if (name == *i) { return count; } - else { - count++; - } + + count++; } /* no views or wrong name */ @@ -1421,7 +1417,7 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa printf("multilayer read: bad channel name: %s\n", name); return 0; } - else if (len == 1) { + if (len == 1) { echan->chan_id = token[0]; } else if (len > 1) { |