From e8f28cb5298b30c251446abd1fed67ce96cc5845 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Fri, 2 May 2014 16:17:50 -0400 Subject: [PATCH] r747: fixed a minor issue in the last (mis)commit --- bwamem.c | 4 ++-- main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bwamem.c b/bwamem.c index 5fb41f8..7ac9bf8 100644 --- a/bwamem.c +++ b/bwamem.c @@ -248,11 +248,11 @@ mem_chain_v mem_chain(const mem_opt_t *opt, const bwt_t *bwt, const bntseq_t *bn l_rep += e - b; for (i = 0; i < aux->mem.n; ++i) { bwtintv_t *p = &aux->mem.a[i]; - int step, slen = (uint32_t)p->info - (p->info>>32); // seed length + int step, count, slen = (uint32_t)p->info - (p->info>>32); // seed length int64_t k; if (slen < opt->min_seed_len) continue; // ignore if too short or too repetitive step = p->x[2] > opt->max_occ? p->x[2] / opt->max_occ : 1; - for (k = 0; k < p->x[2]; k += step) { + for (k = count = 0; k < p->x[2] && count < opt->max_occ; k += step, ++count) { mem_chain_t tmp, *lower, *upper; mem_seed_t s; int rid, to_add = 0; diff --git a/main.c b/main.c index bbeda8e..aa210dd 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.8-r746-dirty" +#define PACKAGE_VERSION "0.7.8-r747-dirty" #endif int bwa_fa2pac(int argc, char *argv[]);