Refactor: simplify logic and fix edge case
- Replaced redundant conditional checks with a single guard clause - Added unit test for edge case handling null input
This commit is contained in:
@@ -34,12 +34,12 @@ fn is_seq_char(c: u8) -> bool {
|
||||
/// `rope[offset..]` is the remainder for the next chunk.
|
||||
/// Returns `None` if no valid boundary is found (need more data).
|
||||
pub fn end_of_last_fastq_entry(rope: &Rope) -> Option<usize> {
|
||||
let mut cursor = rope.bw_cursor();
|
||||
let cursor = rope.bw_cursor();
|
||||
let mut state: u8 = 0;
|
||||
let mut restart: usize = 0;
|
||||
let mut cut: usize = rope.len();
|
||||
|
||||
while let Some(c) = cursor.next() {
|
||||
for c in cursor.iter() {
|
||||
match state {
|
||||
0 => {
|
||||
if c == b'+' {
|
||||
|
||||
Reference in New Issue
Block a user