Skip to content

Commit 99652cc

Browse files
committed
fn COVER_group: exit early when sample is empty
1 parent a317d42 commit 99652cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/dictBuilder/cover.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ fn COVER_group(ctx: &mut COVER_ctx_t, range: Range<usize>) {
400400
ctx.dmerAt[v] = dmerId;
401401
if v >= curSampleEnd {
402402
freq += 1;
403+
if curOffsetPtr.is_empty() {
404+
break;
405+
}
403406
if it.peek().is_some() {
404407
let sampleEndPtr = COVER_lower_bound(curOffsetPtr, v);
405408
curSampleEnd = curOffsetPtr[sampleEndPtr];

0 commit comments

Comments
 (0)