ruff/crates/ruff_python_ast/src/source_code
Charlie Marsh 4782675bf9
Remove lexer-based comment range detection (#5785)
## Summary

I'm doing some unrelated profiling, and I noticed that this method is
actually measurable on the CPython benchmark -- it's > 1% of execution
time. We don't need to lex here, we already know the ranges of all
comments, so we can just do a simple binary search for overlap, which
brings the method down to 0%.

## Test Plan

`cargo test`
2023-07-16 01:03:27 +00:00
..
comment_ranges.rs Remove lexer-based comment range detection (#5785) 2023-07-16 01:03:27 +00:00
generator.rs Upgrade RustPython (#5334) 2023-06-23 20:39:47 +00:00
indexer.rs Remove lexer-based comment range detection (#5785) 2023-07-16 01:03:27 +00:00
line_index.rs Run `rustfmt` on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
locator.rs Move Python whitespace utilities into new `ruff_python_whitespace` crate (#4993) 2023-06-10 00:59:57 +00:00
mod.rs Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
stylist.rs Move Python whitespace utilities into new `ruff_python_whitespace` crate (#4993) 2023-06-10 00:59:57 +00:00