diff --git a/lib/astutils.h b/lib/astutils.h index 18fe9dc4e..f3923f8b6 100644 --- a/lib/astutils.h +++ b/lib/astutils.h @@ -56,11 +56,9 @@ void visitAstNodes(T *ast, const TFunc &visitor) if (!ast) return; - std::vector tokensContainer; // the size of 8 was determined in tests to be sufficient to avoid excess allocations. also add 1 as a buffer. // we might need to increase that value in the future. - tokensContainer.reserve(8 + 1); - std::stack> tokens(std::move(tokensContainer)); + std::stack> tokens; T *tok = ast; do { ChildrenToVisit c = visitor(tok);