diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index d2a5e6f..8498f88 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -470,8 +470,8 @@ namespace chaiscript oss << t_prepend << "(" << ast_node_type_to_string(this->identifier) << ") " << this->text << " : " << this->location.start.line << ", " << this->location.start.column << '\n'; - for (size_t j = 0; j < this->children.size(); ++j) { - oss << this->children[j]->to_string(t_prepend + " "); + for (auto & elem : this->children) { + oss << elem->to_string(t_prepend + " "); } return oss.str(); } diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index 5936713..1fdc4f5 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -67,6 +67,7 @@ namespace chaiscript m_multiline_comment_end("*/"), m_singleline_comment("//") { + m_match_stack.reserve(2); setup_operators(); }