[cover] Stop when segmentSize is less than d

This commit is contained in:
Nick Terrell 2017-08-21 13:10:03 -07:00
parent 4912fc2acc
commit d49eb40c03

View File

@ -622,9 +622,9 @@ static size_t COVER_buildDictionary(const COVER_ctx_t *ctx, U32 *freqs,
/* Select a segment */ /* Select a segment */
COVER_segment_t segment = COVER_selectSegment( COVER_segment_t segment = COVER_selectSegment(
ctx, freqs, activeDmers, epochBegin, epochEnd, parameters); ctx, freqs, activeDmers, epochBegin, epochEnd, parameters);
/* Trim the segment if necessary and if it is empty then we are done */ /* Trim the segment if necessary and if it is too small then we are done */
segmentSize = MIN(segment.end - segment.begin + parameters.d - 1, tail); segmentSize = MIN(segment.end - segment.begin + parameters.d - 1, tail);
if (segmentSize == 0) { if (segmentSize < parameters.d) {
break; break;
} }
/* We fill the dictionary from the back to allow the best segments to be /* We fill the dictionary from the back to allow the best segments to be