From caed1cf71d43051714db6aac696c3f6539c5a175 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 10 Mar 2015 18:41:50 +0000 Subject: [PATCH] Eliminated redundant variable. --- re2c/code.cc | 28 +++++++++++++++++++--------- re2c/dfa.h | 2 -- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/re2c/code.cc b/re2c/code.cc index 85410e9d..7cb6eb93 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -983,7 +983,7 @@ void Go::genCpGoto(OutputFile & o, uint ind, const State *from, const State *nex o << indent(ind); uint ch = 0; - for (uint i = 0; i < lSpans; ++i) + for (uint i = 0; i < nSpans; ++i) { vUsedLabels.insert(span[i].to->label); for(; ch < span[i].ub; ++ch) @@ -992,7 +992,7 @@ void Go::genCpGoto(OutputFile & o, uint ind, const State *from, const State *nex if (ch == 255) { o << "\n"; - i = lSpans; + i = nSpans; break; } else if (ch % 8 == 7) @@ -1017,27 +1017,37 @@ void Go::genGoto(OutputFile & o, uint ind, const State *from, const State *next, genSwitchD (o, from); return; } - +/* + for (uint i = 0; i < nSpans; ++i) + { + if (span[i].ub > 0xFF) + { + wSpans++; + } + } + Span * wspan = new Span[wSpans]; + for (uint i = 0, j = 0; i < nSpans; i++) + { + if (span[i].ub > 0xFF) + { + wspan[j++] = span[i]; + } + } +*/ if (gFlag || (encoding.szCodeUnit() > 1)) { uint nBitmaps = 0; std::set vTargets; wSpans = 0; - lSpans = 1; dSpans = 0; for (uint i = 0; i < nSpans; ++i) { -// if (span[i].ub > 0x100) if (span[i].ub > 0xFF) { -//assert (span[i].ub == 0x100 || encoding.szCodeUnit() > 1); wSpans++; } -// if (span[i].ub <= 0x100 || (encoding.szCodeUnit() <= 1)) if (span[i].ub < 0x100 || (encoding.szCodeUnit() <= 1)) { - lSpans++; - State *to = span[i].to; if (to && to->isBase) diff --git a/re2c/dfa.h b/re2c/dfa.h index 1d69da94..0461d7f2 100644 --- a/re2c/dfa.h +++ b/re2c/dfa.h @@ -169,7 +169,6 @@ public: Go() : nSpans(0) , wSpans(~0u) - , lSpans(~0u) , dSpans(~0u) , lTargets(~0u) , span(NULL) @@ -179,7 +178,6 @@ public: public: uint nSpans; // number of spans uint wSpans; // number of spans in wide mode - uint lSpans; // number of low (non wide) spans uint dSpans; // number of decision spans (decide between g and b mode) uint lTargets; Span *span; -- 2.40.0