Skip to content

Commit 93995ab

Browse files
authored
Add a method to push an aux tag without first checking for existence. (#497)
1 parent 161f759 commit 93995ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bam/record.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,14 @@ impl Record {
859859
if self.aux(tag).is_ok() {
860860
return Err(Error::BamAuxTagAlreadyPresent);
861861
}
862+
self.push_aux_unchecked(tag, value)
863+
}
862864

865+
/// Add auxiliary data, without checking if the tag is present.
866+
///
867+
/// The caller should ensure that the same tag is not pushed more than once.
868+
/// This is provided as a performance optimization.
869+
pub fn push_aux_unchecked(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {
863870
let ctag = tag.as_ptr() as *mut c_char;
864871
let ret = unsafe {
865872
match value {

0 commit comments

Comments
 (0)