]> granicus.if.org Git - re2c/commitdiff
Eliminated redundant variable.
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 10 Mar 2015 18:41:50 +0000 (18:41 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 10 Mar 2015 18:41:50 +0000 (18:41 +0000)
re2c/code.cc
re2c/dfa.h

index 85410e9db8cbca6df451cefb8f67ef3caef5abff..7cb6eb938b30212b504e2eb9e8a06f67e25607e6 100644 (file)
@@ -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<uint> 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)
index 1d69da9483934eee02e6baf75f2232c5d0b30220..0461d7f2baa4c5266f28d9e311f2b9d4c29a293d 100644 (file)
@@ -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;