From: Ulya Trofimovich Date: Wed, 4 Mar 2015 13:12:19 +0000 (+0000) Subject: Removed dead code. X-Git-Tag: 0.15~372 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d36af2c84f60ad45a3be750767c49e55dae7e2a8;p=re2c Removed dead code. Used 'if (next) assert(next->label == from->label + 1);' to ensure that code is really dead (and 'next' is always the next state to 'from'). --- diff --git a/re2c/code.cc b/re2c/code.cc index 2dd7239d..f96bc1fb 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -736,7 +736,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro genIf(o, ind, "!=", s[0].ub, readCh); genGoTo(o, 0, from, bg, readCh); } - if (next->label != from->label + 1 || DFlag) + if (DFlag) { genGoTo(o, ind, from, next, readCh); } @@ -757,12 +757,10 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro if (n == 1) { - // if(bg != next){ if (s[0].to->label != from->label + 1 || DFlag) { genGoTo(o, ind, from, s[0].to, readCh); } - // } return ; } else if (n == 2 && bg == next) @@ -772,7 +770,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro genIf(o, ind, ">=", s[0].ub, readCh); genGoTo(o, 0, from, s[1].to, readCh); } - if (next->label != from->label + 1 || DFlag) + if (DFlag) { genGoTo(o, ind, from, next, readCh); } @@ -790,7 +788,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro } } - if (next->label != from->label + 1 || DFlag) + if (DFlag) { genGoTo(o, ind, from, next, readCh); }