diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-29 14:10:50 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-31 09:29:53 +0000 |
commit | 1f7dcbfd7d0075021e3c8842542f6d233727b0d5 (patch) | |
tree | 0a5f810446aef9f203aa9903c5df67dc27f40f9e /src/xml/sax/qxml_p.h | |
parent | 79a03c84574027aa25e386f0833c66ae9e155bac (diff) |
QtXml: replace a QStack<QString> with std::stack<QString, QStringList>
A QStringList is almost as efficient as a QVector<QString>.
More importantly, the QStringList case can share code with
the myriad of other QStringList users, in particular
because std::stack is but the thinnest of wrappers around
its underlying container.
Saves more than 1KiB in text size on optimized GCC 4.9
Linux AMD64 builds.
Change-Id: Ia9c1f8b8c6d3b619f587a0cc0f662462d1b6bdc5
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/xml/sax/qxml_p.h')
-rw-r--r-- | src/xml/sax/qxml_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h index 013c2618a3..275f61a1f3 100644 --- a/src/xml/sax/qxml_p.h +++ b/src/xml/sax/qxml_p.h @@ -38,6 +38,8 @@ #include <qmap.h> #include <qxml.h> +#include <stack> + QT_BEGIN_NAMESPACE // @@ -61,7 +63,7 @@ private: void initIncrementalParsing(); // used to determine if elements are correctly nested - QStack<QString> tags; + std::stack<QString, QStringList> tags; // used by parseReference() and parsePEReference() enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; |