mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
expr: Simplify checking of the end of an expression
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
parent
63ce37cf6e
commit
2a862bc385
1 changed files with 1 additions and 7 deletions
|
@ -244,13 +244,7 @@ where
|
|||
{
|
||||
let mut pattern_chars_clone = pattern_chars.clone();
|
||||
match pattern_chars_clone.next() {
|
||||
Some('\\') => {
|
||||
match pattern_chars_clone.next() {
|
||||
Some(')') // End of a capturing group
|
||||
| Some('|') => true, // End of an alternative pattern
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
Some('\\') => matches!(pattern_chars_clone.next(), Some(')' | '|')),
|
||||
None => true, // No characters left
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue