From 7726029aa93d4e31c53adadd20f834212f4638c1 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 17 May 2016 18:55:03 +0100 Subject: [PATCH] Moved loop-invariant code out of loop. --- re2c/src/ir/dfa/tag_deduplication.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } } } -- 2.40.0