diff --git a/src/bam/overlap.jl b/src/bam/overlap.jl index 186ff59..0e184c9 100644 --- a/src/bam/overlap.jl +++ b/src/bam/overlap.jl @@ -67,7 +67,8 @@ function Base.iterate(iter::OverlapIterator, state) c = compare_intervals(state.record, (state.refindex, iter.interval)) if c == 0 return copy(state.record), state - elseif c > 0 + end + if c > 0 # no more overlapping records in this chunk since records are sorted break end diff --git a/src/bam/reader.jl b/src/bam/reader.jl index 301246c..9ec5d0d 100644 --- a/src/bam/reader.jl +++ b/src/bam/reader.jl @@ -30,10 +30,8 @@ end function Reader(input::IO; index=nothing) if isa(index, AbstractString) index = BAI(index) - else - if index != nothing - error("unrecognizable index argument") - end + elseif index != nothing + error("unrecognizable index argument") end reader = init_bam_reader(input) reader.index = index diff --git a/src/bam/record.jl b/src/bam/record.jl index d0bde20..ad9c6f1 100644 --- a/src/bam/record.jl +++ b/src/bam/record.jl @@ -163,7 +163,8 @@ function checked_refid(record::Record) id = refid(record) if id == 0 throw(ArgumentError("record is not mapped")) - elseif !isdefined(record, :reader) + end + if !isdefined(record, :reader) throw(ArgumentError("reader is not defined")) end return id