diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-01 19:58:21 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-02 12:57:10 +0000 |
commit | 5358728bd93a6582f98023ba8cf9b6f7783d92af (patch) | |
tree | e990f6c8c99c8e1de9026518a3536165d210fa73 | |
parent | 6d5f7b839fab7e05b04fc3090891cf448919defb (diff) |
Modernize Shiboken.getAllValidWrappers()
Task-number: PYSIDE-2046
Change-Id: I09bea4ba6a9793cc576f3a3c8ef44df021744a3a
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 3911525f0b8ee1c8b301ef794cff4bf24e9f68f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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; } } } |