aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-10 12:54:49 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-13 23:09:52 +0100
commita4618cc05784019760800e80e816f2c70acc0ce5 (patch)
tree8daca14a36f3db19e6acc6f41ffb1687397ba299
parent611971d74349d1f9355f8934f079e9b54c360f5a (diff)
shiboken6/Type system parser: Remove m_currentDroppedEntry pointer
It is not needed since the parent pointer is preserved in m_current. Pick-to: 6.2 Task-number: PYSIDE-1766 Change-Id: Iafe1f55e413f04b59b77c3c337dd913e14d22f86 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp18
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.h1
2 files changed, 6 insertions, 13 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 9ea16f8ea..54770b996 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -797,15 +797,8 @@ bool TypeSystemParser::endElement(QStringView localName)
return true;
}
- if (m_currentDroppedEntry) {
- if (m_currentDroppedEntryDepth == 1) {
- m_current = m_currentDroppedEntry->parent;
- delete m_currentDroppedEntry;
- m_currentDroppedEntry = nullptr;
- m_currentDroppedEntryDepth = 0;
- } else {
- --m_currentDroppedEntryDepth;
- }
+ if (m_currentDroppedEntryDepth != 0) {
+ --m_currentDroppedEntryDepth;
return true;
}
@@ -948,8 +941,10 @@ bool TypeSystemParser::endElement(QStringView localName)
template <class String> // QString/QStringRef
bool TypeSystemParser::characters(const String &ch)
{
- if (m_currentDroppedEntry || m_ignoreDepth || m_current->type == StackElement::Unimplemented)
+ if (m_currentDroppedEntryDepth != 0 || m_ignoreDepth != 0
+ || m_current->type == StackElement::Unimplemented) {
return true;
+ }
if (m_current->type == StackElement::Template) {
m_templateEntry->addCode(ch);
@@ -2900,7 +2895,7 @@ bool TypeSystemParser::startElement(const ConditionalStreamReader &reader)
return false;
}
- if (m_currentDroppedEntry) {
+ if (m_currentDroppedEntryDepth) {
++m_currentDroppedEntryDepth;
return true;
}
@@ -2951,7 +2946,6 @@ bool TypeSystemParser::startElement(const ConditionalStreamReader &reader)
const QString identifier = element->type == StackElement::FunctionTypeEntry
? attributes.value(signatureAttribute()).toString() : name;
if (shouldDropTypeEntry(m_database, m_contextStack, identifier)) {
- m_currentDroppedEntry = element.release();
m_currentDroppedEntryDepth = 1;
if (ReportHandler::isDebug(ReportHandler::SparseDebug)) {
qCInfo(lcShiboken, "Type system entry '%s' was intentionally dropped from generation.",
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.h b/sources/shiboken6/ApiExtractor/typesystemparser.h
index 5d5ec5384..c03bc47e7 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.h
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.h
@@ -259,7 +259,6 @@ private:
TypeDatabase* m_database;
StackElement* m_current = nullptr;
- StackElement* m_currentDroppedEntry = nullptr;
int m_currentDroppedEntryDepth = 0;
int m_ignoreDepth = 0;
QString m_defaultPackage;