summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-12-29 14:10:50 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-12-30 12:05:16 +0000
commit5c8186301996780b90e1b7b37b6142e885f3c9b0 (patch)
tree1693189dc3317c5d7e489b556ede79adbb4667b8 /src
parent08adcc62a76b39401c91cbfa7e9f721f0aa5b7f6 (diff)
moc: replace a QStack<QByteArray> with std::stack<QByteArray, QByteArrayList>
A QByteArrayList is almost as efficient as a QVector<QByteArray>. More importantly, the QByteArrayList case can share code with the myriad of other QByteArrayList users, in particular because std::stack is but the thinnest of wrappers around its underlying container. For moc, saves almost 1KiB in text size on optimized GCC 4.9 Linux AMD64 builds. For qdbuscpp2xml, which re-uses moc code, saves ~1.6KiB. Change-Id: I861e92b3c79e47e0ce892ccf54c9041182aaf212 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/parser.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/moc/parser.h b/src/tools/moc/parser.h
index 947e472dae..6b281eb339 100644
--- a/src/tools/moc/parser.h
+++ b/src/tools/moc/parser.h
@@ -34,9 +34,10 @@
#ifndef PARSER_H
#define PARSER_H
-#include <qstack.h>
#include "symbols.h"
+#include <stack>
+
QT_BEGIN_NAMESPACE
class Parser
@@ -57,7 +58,7 @@ public:
};
QList<IncludePath> includes;
- QStack<QByteArray> currentFilenames;
+ std::stack<QByteArray, QByteArrayList> currentFilenames;
inline bool hasNext() const { return (index < symbols.size()); }
inline Token next() { if (index >= symbols.size()) return NOTOKEN; return symbols.at(index++).token; }