Skip to content

Commit

Permalink
Do not check for cariage return after newline character. (#2437)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls committed Jan 22, 2022
1 parent 763e90c commit c1669ea
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions polars/polars-io/src/csv_core/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ pub(crate) fn next_line_position_naive(input: &[u8]) -> Option<usize> {
if input.len() - pos == 0 {
return None;
}
input.get(pos).and_then(|&b| {
Option::from({
if b == b'\r' {
pos + 1
} else {
pos
}
})
})
Some(pos)
}

/// Find the nearest next line position that is not embedded in a String field.
Expand All @@ -53,15 +45,7 @@ pub(crate) fn next_line_position(
.count()
== expected_fields
{
return input.get(pos).and_then(|&b| {
Option::from({
if b == b'\r' {
total_pos + pos + 1
} else {
total_pos + pos
}
})
});
return Some(total_pos + pos);
} else {
input = &input[pos + 1..];
total_pos += pos + 1;
Expand Down

0 comments on commit c1669ea

Please sign in to comment.