From f272b410315c718bfbf76fecc82be37d07b91700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Fri, 13 Mar 2020 22:09:28 +1100 Subject: [PATCH] Flatten --- src/sam/record.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sam/record.jl b/src/sam/record.jl index 6d4b149..e627727 100644 --- a/src/sam/record.jl +++ b/src/sam/record.jl @@ -321,15 +321,15 @@ function alignlength(record::Record)::Int len = 0 # operation length for i in record.cigar c = record.data[i] - if c ∈ UInt8('0'):UInt8('9') + if in(c, UInt8('0'):UInt8('9')) len = len * 10 + (c - UInt8('0')) - else - op = convert(BioAlignments.Operation, Char(c)) - if BioAlignments.ismatchop(op) || BioAlignments.isdeleteop(op) - ret += len - end - len = 0 + continue end + op = convert(BioAlignments.Operation, Char(c)) + if BioAlignments.ismatchop(op) || BioAlignments.isdeleteop(op) #Note: reference consuming ops ('M', 'D', 'N', '=', 'X'). + ret += len + end + len = 0 end return ret end