]> ruin.nu Git - germs.git/commitdiff
a little cleanup and minor fix
authorMichael Andreen <harv@ruin.nu>
Wed, 20 Jun 2007 09:25:07 +0000 (09:25 +0000)
committerMichael Andreen <harv@ruin.nu>
Wed, 20 Jun 2007 09:25:07 +0000 (09:25 +0000)
src/genealgorithms.cpp

index a32968eaea3454f1081649335a34c7e8c201077f..78b0f0572dc283b1e7e8f7278303954ff77cddac 100644 (file)
@@ -139,10 +139,9 @@ std::vector<Component> findComponents(const GeneOrder& go){
                        os[Sdir.top()] = (os[Sdir.top()] == os[s] ? os[s] : 0);
                        s = Sdir.top();
                }
-               if (go[i] > 0 && dir[i] == dir[s] && i - s == p[i] - p[s])
+               if (go[i] > 0 && dir[i] == dir[s] && static_cast<Gene>(i - s) == p[i] - p[s])
                        components.push_back(Component(p[s],p[i],(s+1 == i ? 0 : os[s])));
 
-
                //Reverse
                if (p[i-1] < p[i])
                        Mrev.push(p[i-1]);
@@ -156,8 +155,8 @@ std::vector<Component> findComponents(const GeneOrder& go){
                        os[Srev.top()] *= (os[Srev.top()] == os[s] ? 1 : 0);
                        s = Srev.top();
                }
-               if (go[i] < 0 && rev[i] == rev[s] && i - s == p[s] - p[i])
-                       components.push_back(Component(-p[s],-p[i],os[s]));
+               if (go[i] < 0 && rev[i] == rev[s] && static_cast<Gene>(i - s) == p[s] - p[i])
+                       components.push_back(Component(-p[s],-p[i],(s+1 == i ? 0 : os[s])));
 
                //Update stacks
                if (go[i] > 0)