We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d91a7f1 commit b693e24Copy full SHA for b693e24
src/node.rs
@@ -396,20 +396,16 @@ impl<T: fmt::Debug> Node<T> {
396
m >= s.len()
397
};
398
if right_length {
399
- return bytes
400
- .iter()
401
- .enumerate()
402
- .filter_map(
403
- |(n, b)| if s[0] == *b { Some(n) } else { None },
404
- )
405
- .find_map(|n| {
+ return bytes.iter().position(|b| s[0] == *b).and_then(
+ |n| {
406
node._find(start + n, &bytes[n..], ranges).map(
407
|id| {
408
ranges.push(start..start + n);
409
id
410
},
411
)
412
- });
+ },
+ );
413
}
414
415
None
0 commit comments