From: Ulya Trofimovich Date: Sat, 30 Apr 2016 16:04:27 +0000 (+0100) Subject: Simplified collecting context names during code generation. X-Git-Tag: 1.0~39^2~324 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4378f9e29b2cd491f867d83c62339405c770c74;p=re2c Simplified collecting context names during code generation. --- 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()); }