Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
CodSpeed Performance ReportMerging #7679 will not alter performanceComparing Summary
|
Merge activity
|
96e84d2 to
7cee065
Compare
|
@camc314 Sorry I'm late to the party! I think this is a bit simpler and probably more performant: let search_start_position = expr.left.span().end;
let operator_position_start = source_str.as_bytes().windows(operator_str.len()).enumerate().find_map(|(index, chunk)| {
if chunk == operator_str.as_bytes() {
let pos_start = index as u32 + search_start_position;
let pos_end = pos_start + operator_str.len() as u32;
if !ctx.comments().iter().any(|comment| comment.span.start <= pos_start && pos_end <= comment.span.end) {
return Some(pos_start);
}
}
None
}).unwrap();Iterating over Note 1: I've used Note 2: I don't think As a further optimization, you could maybe narrow down the comments which need searching to only those between I was unaware of the |
Follow-on after #7679. Simplify `do_diagnostic_with_fix`, in particular the search for the operator. Also reduce `span()` calls, as they have a cost.

fixes #7674