bugfix: mis-chaining caused by integer overflow

I really need to rewrite kbtree some time.
This commit is contained in:
Heng Li 2013-02-21 11:42:30 -05:00
parent a9cae8c9af
commit 84a328764a
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@ const bwtintv_v *smem_next(smem_i *itr, int split_len, int split_width)
#include "kbtree.h"
#define chain_cmp(a, b) ((a).pos - (b).pos)
#define chain_cmp(a, b) (((b).pos < (a).pos) - ((a).pos < (b).pos))
KBTREE_INIT(chn, mem_chain_t, chain_cmp)
static int test_and_merge(const mem_opt_t *opt, mem_chain_t *c, const mem_seed_t *p)