- else { break; }
- i++;
- }
-
-// cout << "lastRight\t" << lastRight << endl;
-
- i = lasti;
- while (i < distsRight.size()) {
- if (distsRight[i].dist == lastRight) {
- it = seen.find(db[distsRight[i].index]->getName());
-
- if (it == seen.end()) {
-// cout << "newLoop-right\t" << db[distsRight[i].index]->getName() << '\t' << distsRight[i].dist << endl;
- dists.push_back(distsRight[i]);
- seen[db[distsRight[i].index]->getName()] = db[distsRight[i].index]->getName();
-// numWanted++;
- }
+
+ //add in ties from right
+ i = numWanted;
+ while (i < distsRight.size()) {
+ if (distsRight[i].dist == lastRight) { dists.push_back(distsRight[i]); }
+ else { break; }
+ i++;