diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
commit | a29686eeb3af051a00fbb8a8b9be06bcd050ec8c (patch) | |
tree | 9da60e7257e3e2dafda3e9b565b77c9c6f37675b /source/blender/blenlib/intern/polyfill_2d.c | |
parent | e0c51b466f3b23a1fc114690be2b008e19637ea6 (diff) |
Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.
No functional changes.
Diffstat (limited to 'source/blender/blenlib/intern/polyfill_2d.c')
-rw-r--r-- | source/blender/blenlib/intern/polyfill_2d.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/polyfill_2d.c b/source/blender/blenlib/intern/polyfill_2d.c index 90a4a4f4c2d..d1e2bd58909 100644 --- a/source/blender/blenlib/intern/polyfill_2d.c +++ b/source/blender/blenlib/intern/polyfill_2d.c @@ -177,12 +177,11 @@ BLI_INLINE eSign signum_enum(float a) if (UNLIKELY(a == 0.0f)) { return 0; } - else if (a > 0.0f) { + if (a > 0.0f) { return 1; } - else { - return -1; - } + + return -1; } /** @@ -250,7 +249,7 @@ static uint kdtree2d_balance_recursive( if (totnode <= 0) { return KDNODE_UNSET; } - else if (totnode == 1) { + if (totnode == 1) { return 0 + ofs; } @@ -330,9 +329,8 @@ static void kdtree2d_node_remove(struct KDTree2D *tree, uint index) if (node_index == KDNODE_UNSET) { return; } - else { - tree->nodes_map[index] = KDNODE_UNSET; - } + + tree->nodes_map[index] = KDNODE_UNSET; node = &tree->nodes[node_index]; tree->totnode -= 1; |