Gui: Use auto and range-based for (#7481)

* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent d7792826b4
commit 75acacd1b7
175 changed files with 2051 additions and 2057 deletions

View File

@@ -277,7 +277,7 @@ PyObject* LinkViewPy::getElementPicked(PyObject* args)
return nullptr;
void *ptr = nullptr;
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoPickedPoint *", obj, &ptr, 0);
SoPickedPoint *pp = static_cast<SoPickedPoint*>(ptr);
auto pp = static_cast<SoPickedPoint*>(ptr);
if(!pp)
throw Py::TypeError("type must be of coin.SoPickedPoint");
PY_TRY{
@@ -296,7 +296,7 @@ PyObject* LinkViewPy::getDetailPath(PyObject* args)
return nullptr;
void *ptr = nullptr;
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoPath *", path, &ptr, 0);
SoPath *pPath = static_cast<SoPath*>(ptr);
auto pPath = static_cast<SoPath*>(ptr);
if(!pPath)
throw Py::TypeError("type must be of coin.SoPath");
PY_TRY{