perf(pycodestyle): Initialize Stylist from tokens (#3757)

This commit is contained in:
Micha Reiser 2023-03-28 11:53:35 +02:00 committed by GitHub
parent 000394f428
commit f68c26a506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 200 additions and 172 deletions

View file

@ -173,7 +173,7 @@ pub fn check(contents: &str, options: JsValue) -> Result<JsValue, JsValue> {
let locator = Locator::new(contents);
// Detect the current code style (lazily).
let stylist = Stylist::from_contents(contents, &locator);
let stylist = Stylist::from_tokens(&tokens, &locator);
// Extra indices from the code.
let indexer: Indexer = tokens.as_slice().into();