aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-10 12:54:49 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-14 00:11:51 +0000
commit5682e43fab98c403d2091cc7b9723af4bdb1fff5 (patch)
treecaaca0cf748b05024e061365ec369abf876d5bd2
parentb8fdec7d9b0d27d5b866e081b86a793bcfe25435 (diff)
shiboken6/Type system parser: Remove m_currentDroppedEntry pointer
It is not needed since the parent pointer is preserved in m_current. Task-number: PYSIDE-1766 Change-Id: Iafe1f55e413f04b59b77c3c337dd913e14d22f86 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a4618cc05784019760800e80e816f2c70acc0ce5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 9c925681b..a7ffb1d3e 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);
@@ -2893,7 +2888,7 @@ bool TypeSystemParser::startElement(const ConditionalStreamReader &reader)
return false;
}
- if (m_currentDroppedEntry) {
+ if (m_currentDroppedEntryDepth) {
++m_currentDroppedEntryDepth;
return true;
}
@@ -2944,7 +2939,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;