X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=bedidx.c;h=722877dcc2aa1d414460c328e6e022a22befecfe;hb=9de2ad508fd9055fdd6b2a8b7e9269096a8c0e45;hp=92978318d4ccfbbabeeddd150458245f669062d8;hpb=6154f20a217dfc124ef3016ba6adccd709c00f29;p=tabix.git diff --git a/bedidx.c b/bedidx.c index 9297831..722877d 100644 --- a/bedidx.c +++ b/bedidx.c @@ -4,6 +4,9 @@ #include #include +#include "ksort.h" +KSORT_INIT_GENERIC(uint64_t) + #include "kseq.h" KSTREAM_INIT(gzFile, gzread, 8192) @@ -53,6 +56,7 @@ void bed_index(void *_h) if (kh_exist(h, k)) { bed_reglist_t *p = &kh_val(h, k); if (p->idx) free(p->idx); + ks_introsort(uint64_t, p->n, p->a); p->idx = bed_index_core(p->n, p->a, &p->m); } }