From 5c8186301996780b90e1b7b37b6142e885f3c9b0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 29 Dec 2015 14:10:50 +0100 Subject: moc: replace a QStack with std::stack A QByteArrayList is almost as efficient as a QVector. 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) --- src/tools/moc/parser.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tools/moc') 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 #include "symbols.h" +#include + QT_BEGIN_NAMESPACE class Parser @@ -57,7 +58,7 @@ public: }; QList includes; - QStack currentFilenames; + std::stack currentFilenames; inline bool hasNext() const { return (index < symbols.size()); } inline Token next() { if (index >= symbols.size()) return NOTOKEN; return symbols.at(index++).token; } -- cgit v1.2.3