Use memchr to speedup newline search on x86 (#3985)

This commit is contained in:
Micha Reiser 2023-04-26 21:15:47 +02:00 committed by GitHub
parent f3e6ddda62
commit e04ef42334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 147 additions and 114 deletions

View file

@ -9,9 +9,10 @@ use rustpython_parser::ast::{
};
use rustpython_parser::ConversionFlag;
use crate::newlines::LineEnding;
use ruff_rustpython::vendor::{bytes, str};
use crate::source_code::stylist::{Indentation, LineEnding, Quote, Stylist};
use crate::source_code::stylist::{Indentation, Quote, Stylist};
mod precedence {
pub const ASSIGN: u8 = 3;
@ -1256,9 +1257,10 @@ impl<'a> Generator<'a> {
#[cfg(test)]
mod tests {
use crate::newlines::LineEnding;
use rustpython_parser as parser;
use crate::source_code::stylist::{Indentation, LineEnding, Quote};
use crate::source_code::stylist::{Indentation, Quote};
use crate::source_code::Generator;
fn round_trip(contents: &str) -> String {