From: Ulya Trofimovich Date: Tue, 17 May 2016 17:55:03 +0000 (+0100) Subject: Moved loop-invariant code out of loop. X-Git-Tag: 1.0~39^2~294 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7726029aa93d4e31c53adadd20f834212f4638c1;p=re2c Moved loop-invariant code out of loop. --- diff --git a/re2c/src/ir/dfa/tag_deduplication.cc b/re2c/src/ir/dfa/tag_deduplication.cc index bca0d22e..c82ac598 100644 --- a/re2c/src/ir/dfa/tag_deduplication.cc +++ b/re2c/src/ir/dfa/tag_deduplication.cc @@ -56,15 +56,15 @@ static void calc_live(const dfa_t &dfa, size_t fallback, size_t *live) for (bool loop = true; loop;) { loop = false; for (size_t i = 0; i < nstates; ++i) { + const size_t l = live[i]; dfa_state_t *s = dfa.states[i]; for (size_t c = 0; c < dfa.nchars; ++c) { const size_t j = s->arcs[c]; if (j != dfa_t::NIL) { - const size_t old = live[i]; dfa.tagpool.orl_with_mask(&live[i], live[j], s->tags[c]); - loop |= old != live[i]; } } + loop |= live[i] != l; } } }