mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-11-14 22:33:14 +00:00
Simplify use of appendfrom!
This commit is contained in:
parent
436cfd84ba
commit
946068b2f3
1 changed files with 7 additions and 17 deletions
|
@ -170,18 +170,12 @@ function appendfrom!(dst, dpos, src, spos, n)
|
|||
end
|
||||
|
||||
const action_metainfo = quote
|
||||
|
||||
let markpos = @markpos()
|
||||
|
||||
appendfrom!(metainfo.data, 1, data, markpos, length(markpos:p-1))
|
||||
|
||||
metainfo.filled = @relpos(markpos):@relpos(p-1)
|
||||
appendfrom!(metainfo.data, 1, data, @markpos, p-@markpos)
|
||||
metainfo.filled = 1:(p-@markpos)
|
||||
|
||||
found_metainfo = true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
const sam_actions_metainfo = Dict(
|
||||
:mark => :(@mark),
|
||||
:pos1 => :(pos1 = @relpos(p)),
|
||||
|
@ -231,16 +225,12 @@ const sam_actions_record = Dict(
|
|||
:record_qual => :(record.qual = pos:@relpos(p-1)),
|
||||
:record_field => :(push!(record.fields, pos:@relpos(p-1))),
|
||||
:record => quote
|
||||
let markpos = @markpos()
|
||||
|
||||
appendfrom!(record.data, 1, data, markpos, length(markpos:p-1))
|
||||
|
||||
record.filled = @relpos(markpos):@relpos(p-1)
|
||||
appendfrom!(record.data, 1, data, @markpos, p-@markpos)
|
||||
record.filled = 1:(p-@markpos)
|
||||
|
||||
found_record = true
|
||||
@escape
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
const sam_actions_body = merge(
|
||||
|
|
Loading…
Reference in a new issue