From 789cccbaff4c0a58fa6418c3ba0e90ce794114e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Sun, 2 Feb 2020 21:32:02 +1100 Subject: [PATCH] Flatten elseif --- src/bam/overlap.jl | 3 ++- src/bam/reader.jl | 6 ++---- src/bam/record.jl | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) 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