diff options
-rw-r--r-- | sources/shiboken6/shibokenmodule/typesystem_shiboken.xml | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml index e0137f4a3..34079eb44 100644 --- a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml +++ b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml @@ -87,17 +87,16 @@ <add-function signature="getAllValidWrappers(void)" return-type="PySequence*"> <inject-code> - std::set<PyObject*> setAll = Shiboken::BindingManager::instance().getAllPyObjects(); + const auto setAll = Shiboken::BindingManager::instance().getAllPyObjects(); PyObject* listAll = PyList_New(0); - if (listAll == NULL) - return NULL; + if (listAll == nullptr) + return nullptr; - const std::set<PyObject*>::iterator end = setAll.end(); - for (std::set<PyObject*>::iterator iter = setAll.begin(); iter != end; ++iter) { - if (*iter != NULL) { - if (PyList_Append(listAll, *iter) != 0) { + for (auto *o : setAll) { + if (o != nullptr) { + if (PyList_Append(listAll, o) != 0) { Py_DECREF(listAll); - return NULL; + return nullptr; } } } |