]> granicus.if.org Git - re2c/commitdiff
Simplified collecting context names during code generation.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 30 Apr 2016 16:04:27 +0000 (17:04 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 30 Apr 2016 16:04:27 +0000 (17:04 +0100)
re2c/src/codegen/emit_dfa.cc

index fa44bb86785c6f30d073c182a5d40bcb8cf17ebd..08d0bd40dfb1c87ec7dc188bf3a2e90679b0f7e5 100644 (file)
@@ -147,10 +147,8 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra
 
        std::set<std::string> ctxnames;
        if (base_ctxmarker) {
-               for (State *s = head; s; s = s->next) {
-                       for (std::set<size_t>::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());
        }