Base: Replace if else with switch statement

This commit is contained in:
Ladislav Michl
2024-01-20 18:18:09 +01:00
committed by 3x380V
parent 95b37fa806
commit f1fdd2e2a9
5 changed files with 115 additions and 121 deletions

View File

@@ -250,7 +250,7 @@ PyObject* VectorPy::mapping_subscript(PyObject* self, PyObject* item)
return PyTuple_New(0);
}
if (start == 0 && step == 1 && slicelength == sequence_length(self)
&& PyObject_TypeCheck(self, &(VectorPy::Type))) {
&& PyObject_TypeCheck(self, &(VectorPy::Type))) {
Base::Vector3d v = static_cast<VectorPy*>(self)->value();
Py::Tuple xyz(3);
xyz.setItem(0, Py::Float(v.x));