[Bf-blender-cvs] [89196765ba2] master: Cleanup: Clang tidy else after return
Hans Goudey
noreply at git.blender.org
Wed Feb 24 19:57:55 CET 2021
Commit: 89196765ba28e3d48e45c0f9f3c69d9d0b5fb624
Author: Hans Goudey
Date: Wed Feb 24 12:57:49 2021 -0600
Branches: master
https://developer.blender.org/rB89196765ba28e3d48e45c0f9f3c69d9d0b5fb624
Cleanup: Clang tidy else after return
===================================================================
M source/blender/editors/gpencil/gpencil_interpolate.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index ae3dae326c0..7c541f61d75 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -220,28 +220,27 @@ static bool gpencil_stroke_need_flip(Depsgraph *depsgraph,
/* `(S)--->(E) (E)<---(S)` */
return (dist_start >= dist_end);
}
- else {
- /* Oriented inversed with original stroke start near of destination stroke.
- * `(E)<----(S) <--->` */
- dist_start = len_squared_v2v2(v_from_start, v_to_start);
- dist_end = len_squared_v2v2(v_from_start, v_to_end);
- /* `(E)<---(S) (S)--->(E)` */
- return (dist_start < dist_end);
- }
+
+ /* Oriented inversed with original stroke start near of destination stroke.
+ * `(E)<----(S) <--->` */
+ dist_start = len_squared_v2v2(v_from_start, v_to_start);
+ dist_end = len_squared_v2v2(v_from_start, v_to_end);
+ /* `(E)<---(S) (S)--->(E)` */
+ return (dist_start < dist_end);
}
return true;
}
- else {
- /* Check that both vectors have the same direction. */
- float v1[2], v2[2];
- sub_v2_v2v2(v1, v_from_end, v_from_start);
- sub_v2_v2v2(v2, v_to_end, v_to_start);
- mul_v2_v2v2(v1, v1, v2);
- if ((v1[0] < 0.0f) && (v1[1] < 0.0f)) {
- return true;
- }
+
+ /* Check that both vectors have the same direction. */
+ float v1[2], v2[2];
+ sub_v2_v2v2(v1, v_from_end, v_from_start);
+ sub_v2_v2v2(v2, v_to_end, v_to_start);
+ mul_v2_v2v2(v1, v1, v2);
+ if ((v1[0] < 0.0f) && (v1[1] < 0.0f)) {
+ return true;
}
+
return false;
}
More information about the Bf-blender-cvs
mailing list