1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-14 14:23:11 +00:00

Add eof check

The addition of an eof check appears to cover a corner case detailed at https://github.com/BioJulia/XAM.jl/issues/31#issuecomment-787480072.
This commit is contained in:
Ciarán O’Mara 2021-07-03 22:50:31 +10:00
parent 0e6ef62e3e
commit 055c36408c

View file

@ -62,7 +62,7 @@ end
function Base.iterate(iter::OverlapIterator, state)
while state.chunkid lastindex(state.chunks)
chunk = state.chunks[state.chunkid]
while BGZFStreams.virtualoffset(iter.reader.stream) < chunk.stop
while !eof(iter.reader) && BGZFStreams.virtualoffset(iter.reader.stream) < chunk.stop
read!(iter.reader, state.record)
c = compare_intervals(state.record, (state.refindex, iter.interval))
if c == 0