mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-04 02:34:10 +02:00
minor parse optimizations
This commit is contained in:
parent
3f51270509
commit
97ad9d634b
3 changed files with 13 additions and 3 deletions
|
|
@ -285,7 +285,14 @@ fn param_parse_with<'a, T, P: Fn(&'a str) -> IResult<&'a str, T>>(
|
|||
|
||||
let input = &input[has_open as usize..];
|
||||
|
||||
Ok((input.trim_start_matches(' '), value))
|
||||
debug_assert!(
|
||||
input.is_empty() || input.as_bytes()[0] == b' ',
|
||||
"\"{}\" starts with space",
|
||||
input
|
||||
);
|
||||
|
||||
let input = &input[(!input.is_empty() as usize)..];
|
||||
Ok((input, value))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue