We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56e2af5 commit fe25c15Copy full SHA for fe25c15
1 file changed
lib/astutils.h
@@ -33,6 +33,7 @@
33
#include "config.h"
34
#include "errortypes.h"
35
#include "library.h"
36
+#include "smallvector.h"
37
#include "symboldatabase.h"
38
39
class Settings;
@@ -55,11 +56,9 @@ void visitAstNodes(T *ast, const TFunc &visitor)
55
56
if (!ast)
57
return;
58
- std::vector<T *> tokensContainer;
59
// the size of 8 was determined in tests to be sufficient to avoid excess allocations. also add 1 as a buffer.
60
// we might need to increase that value in the future.
61
- tokensContainer.reserve(8 + 1);
62
- std::stack<T *, std::vector<T *>> tokens(std::move(tokensContainer));
+ std::stack<T *, SmallVector<T *, 8 + 1>> tokens;
63
T *tok = ast;
64
do {
65
ChildrenToVisit c = visitor(tok);
0 commit comments