Skip to content

Conversation

@sjackman
Copy link
Contributor

@sjackman sjackman commented Dec 10, 2025

Remove the unnecessary heap allocation in Record::aux and Record::remove_aux by removing the call to CString::new and using the tag byte slice directly. The BAM tag passed to htslib::bam_aux_get does not need to be null terminated. Return Error::BamAuxStringError if the length of the tag is not equal to 2.

See bam_aux_get

@coveralls
Copy link

coveralls commented Dec 10, 2025

Pull Request Test Coverage Report for Build 20109103460

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 81.922%

Totals Coverage Status
Change from base Build 20034470963: 0.01%
Covered Lines: 2787
Relevant Lines: 3402

💛 - Coveralls

Remove the unnecessary heap allocation in `Record::aux` and `Record::remove_aux` by removing the call to `CString::new` and using the byte slice directly. The BAM tag does not need to be null terminated. Return `Error::BamAuxStringError` if the length of the tag is not equal to 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants