From 9299a79715f5b11b0ab26bff80ab7a610030b126 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 20 Jun 2007 09:25:07 +0000 Subject: [PATCH] a little cleanup and minor fix --- src/genealgorithms.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/genealgorithms.cpp b/src/genealgorithms.cpp index a32968e..78b0f05 100644 --- a/src/genealgorithms.cpp +++ b/src/genealgorithms.cpp @@ -139,10 +139,9 @@ std::vector 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(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 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(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) -- 2.39.2