From a4378f9e29b2cd491f867d83c62339405c770c74 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sat, 30 Apr 2016 17:04:27 +0100 Subject: [PATCH] Simplified collecting context names during code generation. --- re2c/src/codegen/emit_dfa.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index fa44bb86..08d0bd40 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -147,10 +147,8 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra std::set ctxnames; if (base_ctxmarker) { - for (State *s = head; s; s = s->next) { - for (std::set::const_iterator i = s->ctxs.begin(); i != s->ctxs.end(); ++i) { - ctxnames.insert(contexts[*i].name()); - } + for (size_t i = 0; i < contexts.size(); ++i) { + ctxnames.insert(contexts[i].name()); } ob.contexts.insert(ctxnames.begin(), ctxnames.end()); } -- 2.40.0