1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-15 06:43:10 +00:00

Simplify use of appendfrom!

This commit is contained in:
Ciarán O'Mara 2020-06-22 10:21:32 +10:00
parent 436cfd84ba
commit 946068b2f3

View file

@ -170,16 +170,10 @@ function appendfrom!(dst, dpos, src, spos, n)
end end
const action_metainfo = quote const action_metainfo = quote
appendfrom!(metainfo.data, 1, data, @markpos, p-@markpos)
let markpos = @markpos() metainfo.filled = 1:(p-@markpos)
appendfrom!(metainfo.data, 1, data, markpos, length(markpos:p-1))
metainfo.filled = @relpos(markpos):@relpos(p-1)
found_metainfo = true found_metainfo = true
end
end end
const sam_actions_metainfo = Dict( const sam_actions_metainfo = Dict(
@ -231,16 +225,12 @@ const sam_actions_record = Dict(
:record_qual => :(record.qual = pos:@relpos(p-1)), :record_qual => :(record.qual = pos:@relpos(p-1)),
:record_field => :(push!(record.fields, pos:@relpos(p-1))), :record_field => :(push!(record.fields, pos:@relpos(p-1))),
:record => quote :record => quote
let markpos = @markpos() appendfrom!(record.data, 1, data, @markpos, p-@markpos)
record.filled = 1:(p-@markpos)
appendfrom!(record.data, 1, data, markpos, length(markpos:p-1))
record.filled = @relpos(markpos):@relpos(p-1)
found_record = true found_record = true
@escape @escape
end end
end
) )
const sam_actions_body = merge( const sam_actions_body = merge(