diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-18 12:39:27 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-30 13:46:50 +0000 |
commit | 8c3b9c0d847656f7a254490047d40cf54e2847a1 (patch) | |
tree | 20eeb21c47ab95a97cdd7161d748b3df7fab0be6 /sources/shiboken2/libshiboken/sbkenum.cpp | |
parent | fee4a7f9fa7177e94ab4853b049fca093e2849fc (diff) |
libshiboken: Refactor loops
Avoid repeated invocation of container.end() in the loop condition
by either assigning to a variable or use range-based-for where
possible.
Use auto for iterators to allow for changing the container type.
Task-number: PYSIDE-727
Change-Id: I5217207a3a7fb60823ccbcbf0915bf6cf21a3e4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkenum.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/sbkenum.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp index bd007f079..e413dc96e 100644 --- a/sources/shiboken2/libshiboken/sbkenum.cpp +++ b/sources/shiboken2/libshiboken/sbkenum.cpp @@ -650,8 +650,6 @@ DeclaredEnumTypes::DeclaredEnumTypes() DeclaredEnumTypes::~DeclaredEnumTypes() { - std::list<PyTypeObject*>::const_iterator it = m_enumTypes.begin(); - for (; it != m_enumTypes.end(); ++it) { /* * PYSIDE-595: This was "delete *it;" before introducing 'PyType_FromSpec'. * XXX what should I do now? @@ -660,8 +658,8 @@ DeclaredEnumTypes::~DeclaredEnumTypes() * So right now I am doing nothing. Surely wrong but no crash. * See also the comment in function 'createGlobalEnumItem'. */ - //fprintf(stderr, "ttt %d %s\n", Py_REFCNT(*it), *it->tp_name); - } + // for (PyTypeObject *o : m_enumTypes) + // fprintf(stderr, "ttt %d %s\n", Py_REFCNT(o), o->tp_name); m_enumTypes.clear(); } |