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. # Conflicts: # src/bam/overlap.jl
This commit is contained in:
parent
48ceb8d20e
commit
f6e87dffa8
1 changed files with 4 additions and 1 deletions
|
@ -63,7 +63,10 @@ function Base.iterate(iter::OverlapIterator, state)
|
|||
while state.chunkid ≤ lastindex(state.chunks)
|
||||
chunk = state.chunks[state.chunkid]
|
||||
while VirtualOffset(iter.reader.stream) < chunk.stop
|
||||
read!(iter.reader, state.record)
|
||||
if BioGenerics.IO.tryread!(iter.reader, state.record) === nothing
|
||||
# no more overlapping records in this chunk since the end of the chunk was reached.
|
||||
break
|
||||
end
|
||||
c = compare_intervals(state.record, (state.refindex, iter.interval))
|
||||
if c == 0
|
||||
return copy(state.record), state
|
||||
|
|
Loading…
Reference in a new issue