From d6019d3e7c3114e754ffd51d76aec4697ea7660d Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Sat, 26 Aug 2023 15:57:32 +0200 Subject: [PATCH] Get rid of tries use high_scores.size() instead. --- src/aln.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/aln.cpp b/src/aln.cpp index 48d1a844..93383d42 100644 --- a/src/aln.cpp +++ b/src/aln.cpp @@ -725,7 +725,7 @@ inline void align_PE( std::array& details, float dropoff, i_dist_est &isize_est, - int max_tries, + unsigned max_tries, size_t max_secondary ) { const auto mu = isize_est.mu; @@ -851,11 +851,11 @@ inline void align_PE( // Turn pairs of high-scoring NAMs into pairs of alignments std::vector high_scores; - int tries = 0; auto max_score = joint_nam_scores[0].score; for (auto &[score_, n1, n2] : joint_nam_scores) { float score_dropoff = (float) score_ / max_score; - if (tries >= max_tries || score_dropoff < dropoff) { + + if (high_scores.size() >= max_tries || score_dropoff < dropoff) { break; } @@ -921,8 +921,6 @@ inline void align_PE( ScoredAlignmentPair aln_pair{combined_score, a1, a2}; high_scores.push_back(aln_pair); - - tries++; } // Finally, add highest scores of both mates as individually mapped