Commit 45f1370
committed
fix: catch out-of-range k-mer lengths in debug builds for public APIs
reverse_complement_bits already asserted 1 <= k <= 32 in debug, but
lacked a comment explaining the release-mode behaviour. validate_and_pack
asserted non-empty input but silently truncated sequences longer than 32.
Add debug_assert!(seq.len() <= 32) and a SAFETY comment so misuse is
caught early in tests without penalising release performance.1 parent 355d830 commit 45f1370
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
| |||
534 | 537 | | |
535 | 538 | | |
536 | 539 | | |
537 | | - | |
| 540 | + | |
538 | 541 | | |
539 | 542 | | |
540 | 543 | | |
| |||
557 | 560 | | |
558 | 561 | | |
559 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
560 | 568 | | |
561 | 569 | | |
562 | 570 | | |
| |||
0 commit comments