Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-08-07 12:23:02 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-07 12:23:02 +0300
commita29686eeb3af051a00fbb8a8b9be06bcd050ec8c (patch)
tree9da60e7257e3e2dafda3e9b565b77c9c6f37675b /source/blender/blenlib/intern/sort_utils.c
parente0c51b466f3b23a1fc114690be2b008e19637ea6 (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/sort_utils.c')
-rw-r--r--source/blender/blenlib/intern/sort_utils.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/source/blender/blenlib/intern/sort_utils.c b/source/blender/blenlib/intern/sort_utils.c
index 09babd3d424..e02d77de0c7 100644
--- a/source/blender/blenlib/intern/sort_utils.c
+++ b/source/blender/blenlib/intern/sort_utils.c
@@ -44,12 +44,11 @@ int BLI_sortutil_cmp_float(const void *a_, const void *b_)
if (a->sort_value > b->sort_value) {
return 1;
}
- else if (a->sort_value < b->sort_value) {
+ if (a->sort_value < b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_)
@@ -59,12 +58,11 @@ int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_)
if (a->sort_value < b->sort_value) {
return 1;
}
- else if (a->sort_value > b->sort_value) {
+ if (a->sort_value > b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
@@ -74,12 +72,11 @@ int BLI_sortutil_cmp_int(const void *a_, const void *b_)
if (a->sort_value > b->sort_value) {
return 1;
}
- else if (a->sort_value < b->sort_value) {
+ if (a->sort_value < b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
int BLI_sortutil_cmp_int_reverse(const void *a_, const void *b_)
@@ -89,12 +86,11 @@ int BLI_sortutil_cmp_int_reverse(const void *a_, const void *b_)
if (a->sort_value < b->sort_value) {
return 1;
}
- else if (a->sort_value > b->sort_value) {
+ if (a->sort_value > b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
int BLI_sortutil_cmp_ptr(const void *a_, const void *b_)
@@ -104,12 +100,11 @@ int BLI_sortutil_cmp_ptr(const void *a_, const void *b_)
if (a->sort_value > b->sort_value) {
return 1;
}
- else if (a->sort_value < b->sort_value) {
+ if (a->sort_value < b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_)
@@ -119,10 +114,9 @@ int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_)
if (a->sort_value < b->sort_value) {
return 1;
}
- else if (a->sort_value > b->sort_value) {
+ if (a->sort_value > b->sort_value) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}