From 5358728bd93a6582f98023ba8cf9b6f7783d92af Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Sep 2022 19:58:21 +0200 Subject: Modernize Shiboken.getAllValidWrappers() Task-number: PYSIDE-2046 Change-Id: I09bea4ba6a9793cc576f3a3c8ef44df021744a3a Reviewed-by: Adrian Herrmann Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer (cherry picked from commit 3911525f0b8ee1c8b301ef794cff4bf24e9f68f1) Reviewed-by: Qt Cherry-pick Bot --- sources/shiboken6/shibokenmodule/typesystem_shiboken.xml | 15 +++++++-------- 1 file 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 @@ - 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; } } } -- cgit v1.2.3