casts clean (#11548)

* remove unecessary casts

clean unused code

revert  example py code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mosfet80
2023-12-04 17:51:36 +01:00
committed by GitHub
parent ea8b5b4b39
commit f9f1f88426
5 changed files with 46 additions and 82 deletions

View File

@@ -102,13 +102,13 @@ void PropertyGreyValueList::setPyObject(PyObject* value)
throw Py::TypeError(error);
}
values[i] = (float)PyFloat_AsDouble(item);
values[i] = PyFloat_AsDouble(item);
}
setValues(values);
}
else if (PyFloat_Check(value)) {
setValue((float)PyFloat_AsDouble(value));
setValue(PyFloat_AsDouble(value));
}
else {
std::string error = std::string("type must be float or list of float, not ");