code cleanup: add break statements in switch ()'s, (even at the last case).
This commit is contained in:
@@ -720,8 +720,8 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
short use_a = TRUE;
|
||||
short use_b = TRUE;
|
||||
bool use_a = true;
|
||||
bool use_b = true;
|
||||
float lambda;
|
||||
|
||||
PyObject *ret = PyTuple_New(2);
|
||||
@@ -729,15 +729,16 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
|
||||
switch (isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
|
||||
case 1:
|
||||
if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
|
||||
use_b = FALSE;
|
||||
use_b = false;
|
||||
break;
|
||||
case 2:
|
||||
if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
|
||||
if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE;
|
||||
break;
|
||||
default:
|
||||
use_a = FALSE;
|
||||
use_b = FALSE;
|
||||
use_a = false;
|
||||
use_b = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 3, Py_NEW, NULL)); }
|
||||
@@ -811,6 +812,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
|
||||
default:
|
||||
use_a = false;
|
||||
use_b = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 2, Py_NEW, NULL)); }
|
||||
|
||||
Reference in New Issue
Block a user