Skip to content

Commit 61557ad

Browse files
committed
Simplify LongSequence(::LongSequence, ::UnitRange)
1 parent 03904b4 commit 61557ad

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/longsequences/constructors.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ Base.empty(::Type{T}) where {T <: LongSequence} = T(UInt[], UInt(0))
4646

4747
# Constructors from other sequences
4848
# TODO: Remove this method, since the user can just slice
49-
function LongSequence(other::LongSequence, part::AbstractUnitRange{<:Integer})
50-
checkbounds(other, part)
51-
subseq = typeof(other)(undef, length(part))
52-
copyto!(subseq, 1, other, first(part), length(part))
53-
return subseq
54-
end
49+
LongSequence(s::LongSequence, xs::AbstractUnitRange{<:Integer}) = s[xs]
5550

5651
function LongSequence(seq::BioSequence{A}) where {A <: Alphabet}
5752
return LongSequence{A}(seq)

0 commit comments

Comments
 (0)