mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #19321 - emilio:supports-dumb, r=SimonSapin
style: Avoid unneessary malloc churn when evaluating @supports rules. <!-- 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/19321) <!-- Reviewable:end -->
This commit is contained in:
commit
06d834c1b9
1 changed files with 2 additions and 2 deletions
|
@ -256,7 +256,7 @@ impl Declaration {
|
||||||
let mut input = ParserInput::new(&self.0);
|
let mut input = ParserInput::new(&self.0);
|
||||||
let mut input = Parser::new(&mut input);
|
let mut input = Parser::new(&mut input);
|
||||||
input.parse_entirely(|input| -> Result<(), CssParseError<()>> {
|
input.parse_entirely(|input| -> Result<(), CssParseError<()>> {
|
||||||
let prop = input.expect_ident().unwrap().as_ref().to_owned();
|
let prop = input.expect_ident_cloned().unwrap();
|
||||||
input.expect_colon().unwrap();
|
input.expect_colon().unwrap();
|
||||||
|
|
||||||
let id = PropertyId::parse(&prop)
|
let id = PropertyId::parse(&prop)
|
||||||
|
@ -264,7 +264,7 @@ impl Declaration {
|
||||||
|
|
||||||
let mut declarations = SourcePropertyDeclaration::new();
|
let mut declarations = SourcePropertyDeclaration::new();
|
||||||
input.parse_until_before(Delimiter::Bang, |input| {
|
input.parse_until_before(Delimiter::Bang, |input| {
|
||||||
PropertyDeclaration::parse_into(&mut declarations, id, prop.into(), &context, input)
|
PropertyDeclaration::parse_into(&mut declarations, id, prop, &context, input)
|
||||||
.map_err(|_| input.new_custom_error(()))
|
.map_err(|_| input.new_custom_error(()))
|
||||||
})?;
|
})?;
|
||||||
let _ = input.try(parse_important);
|
let _ = input.try(parse_important);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue