Skip to content

Remove redundant copy in getSequenceInRange#1385

Draft
nh13 wants to merge 1 commit intopysam-developers:masterfrom
nh13:nh13/fix-sequence-range-copy
Draft

Remove redundant copy in getSequenceInRange#1385
nh13 wants to merge 1 commit intopysam-developers:masterfrom
nh13:nh13/fix-sequence-range-copy

Conversation

@nh13
Copy link
Contributor

@nh13 nh13 commented Mar 2, 2026

Summary

  • Remove a redundant copy in getSequenceInRange where charptr_to_bytes(seq) was called on seq which is already a Python bytes object created by PyBytes_FromStringAndSize
  • The charptr_to_bytes call was converting bytes → const char* → bytes, creating an unnecessary copy

Test plan

  • Run REF_PATH=: pytest tests/AlignedSegment_test.py -v

AI disclosure: This PR was AI-assisted using Claude Code. The issue was identified via AI-guided code review, and the implementation was drafted by AI with human review and approval.

@nh13 nh13 marked this pull request as draft March 3, 2026 06:21
@nh13 nh13 changed the title perf: remove redundant copy in getSequenceInRange Remove redundant copy in getSequenceInRange Mar 3, 2026
@nh13 nh13 force-pushed the nh13/fix-sequence-range-copy branch from a8d3cbb to 028f834 Compare March 3, 2026 06:24
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.

1 participant