mirror of
https://github.com/servo/servo.git
synced 2025-10-02 01:29:15 +01:00
Auto merge of #17967 - jdm:parsefun, r=SimonSapin
CSS parsing optimizations These address some small inefficiencies that showed up while profiling the myspace talos test. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17967) <!-- Reviewable:end -->
This commit is contained in:
commit
aef95cf195
2 changed files with 12 additions and 13 deletions
|
@ -77,7 +77,7 @@ fn escape_css_ident(ident: &str) -> String {
|
|||
return ident.into()
|
||||
}
|
||||
|
||||
let mut escaped = String::new();
|
||||
let mut escaped = String::with_capacity(ident.len());
|
||||
|
||||
// A leading dash does not need to be escaped as long as it is not the
|
||||
// *only* character in the identifier.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue