Pass some 48-bytes closures by references instead of by value.

This commit is contained in:
Simon Sapin 2017-06-22 02:01:08 +02:00
parent ed5485ed18
commit 837cb6ddb2
3 changed files with 8 additions and 8 deletions

View file

@ -333,7 +333,7 @@
let quirks_mode = context.quirks_mode; let quirks_mode = context.quirks_mode;
::properties::substitute_variables_${property.ident}( ::properties::substitute_variables_${property.ident}(
&declared_value, &custom_props, &declared_value, &custom_props,
|value| { &mut |value| {
if let Some(ref mut cascade_info) = *cascade_info { if let Some(ref mut cascade_info) = *cascade_info {
cascade_info.on_cascade_property(&declaration, cascade_info.on_cascade_property(&declaration,
&value); &value);

View file

@ -582,7 +582,7 @@ impl AnimationValue {
&variables.url_data, &variables.url_data,
variables.from_shorthand, variables.from_shorthand,
&custom_props, &custom_props,
|v| { &mut |v| {
let declaration = match *v { let declaration = match *v {
DeclaredValue::Value(value) => { DeclaredValue::Value(value) => {
PropertyDeclaration::${prop.camel_case}(value.clone()) PropertyDeclaration::${prop.camel_case}(value.clone())

View file

@ -373,13 +373,13 @@ impl PropertyDeclarationIdSet {
value: &DeclaredValue<longhands::${property.ident}::SpecifiedValue>, value: &DeclaredValue<longhands::${property.ident}::SpecifiedValue>,
% endif % endif
custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>, custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>,
f: F, f: &mut F,
error_reporter: &ParseErrorReporter, error_reporter: &ParseErrorReporter,
quirks_mode: QuirksMode) quirks_mode: QuirksMode)
% if property.boxed: % if property.boxed:
where F: FnOnce(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>) where F: FnMut(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>)
% else: % else:
where F: FnOnce(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>) where F: FnMut(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>)
% endif % endif
{ {
if let DeclaredValue::WithVariables(ref with_variables) = *value { if let DeclaredValue::WithVariables(ref with_variables) = *value {
@ -404,13 +404,13 @@ impl PropertyDeclarationIdSet {
url_data: &UrlExtraData, url_data: &UrlExtraData,
from_shorthand: Option<ShorthandId>, from_shorthand: Option<ShorthandId>,
custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>, custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>,
f: F, f: &mut F,
error_reporter: &ParseErrorReporter, error_reporter: &ParseErrorReporter,
quirks_mode: QuirksMode) quirks_mode: QuirksMode)
% if property.boxed: % if property.boxed:
where F: FnOnce(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>) where F: FnMut(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>)
% else: % else:
where F: FnOnce(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>) where F: FnMut(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>)
% endif % endif
{ {
f(& f(&