Mark is_valid(::Variant) as private function

This commit is contained in:
Thomas A. Christensen II 2023-01-03 20:19:58 -06:00
parent 2719c438f3
commit 2f4f5fb5ae

View file

@ -10,7 +10,7 @@ end
function Variant{S,T}(ref::S, edits::Vector{Edit{S,T}}) where {S<:BioSequence,T<:BioSymbol} function Variant{S,T}(ref::S, edits::Vector{Edit{S,T}}) where {S<:BioSequence,T<:BioSymbol}
sort!(edits; by=x -> x.pos) sort!(edits; by=x -> x.pos)
result = Variant{S,T}(ref, edits, Unsafe()) result = Variant{S,T}(ref, edits, Unsafe())
is_valid(result) || error("TODO") # report what kind of error message? _is_valid(result) || error("TODO") # report what kind of error message?
return result return result
end end
@ -31,7 +31,7 @@ end
# Validate: # Validate:
# A sequence is invalid if any of its operations are out of bounds, or the same position # A sequence is invalid if any of its operations are out of bounds, or the same position
# is affected by multiple edits. # is affected by multiple edits.
function is_valid(v::Variant) function _is_valid(v::Variant)
isempty(v.ref) && return false isempty(v.ref) && return false
valid_positions = 1:length(v.ref) valid_positions = 1:length(v.ref)
last_was_insert = false last_was_insert = false