]> git.donarmstrong.com Git - mothur.git/blobdiff - decalc.cpp
fixed template=self thing
[mothur.git] / decalc.cpp
index c600a7f56633c270ec83810a306ad71ca3cd65c8..f6203827baec8e2575532ef43b0b2e3703745ca7 100644 (file)
@@ -789,7 +789,7 @@ vector<Sequence*> DeCalculator::findClosest(Sequence* querySeq, vector<Sequence*
                float lastRight = distsRight[0].dist;
                float lastLeft = distsLeft[0].dist;
                //int lasti = 0;
-               for (int i = 0; i < numWanted+1; i++) {
+               for (int i = 0; i < distsLeft.size(); i++) {
                        
                        if (m->control_pressed) { return seqsMatches; }
                        
@@ -811,6 +811,8 @@ vector<Sequence*> DeCalculator::findClosest(Sequence* querySeq, vector<Sequence*
 //                             cout << "loop-right\t" << db[distsRight[i].index]->getName() << '\t' << distsRight[i].dist << endl;
                        }
                        
+                       if (i == numWanted) { break; }
+                       
                }
                
                //are we still above the minimum similarity cutoff