Optimize moc: Preallocate space for list of arguments on the stack.

This removes the temporary QList allocations.

Change-Id: I1f255e94730202f719e0a97b9ab4a83e28b805c1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Milian Wolff 2015-05-31 00:04:09 +02:00
parent aa42a1a67e
commit c05f2d04f2

View File

@ -597,7 +597,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
syms.last().lineNum = lineNum;
return syms;
}
QList<Symbols> arguments;
QVarLengthArray<Symbols, 5> arguments;
while (symbols.hasNext()) {
Symbols argument;
// strip leading space