Remove 5k from AnimationValue::compute_squared_distance.

This commit is contained in:
Josh Matthews 2017-09-07 12:48:14 -07:00
parent 799014755e
commit 01c35f99cd
2 changed files with 12 additions and 4 deletions

View file

@ -568,6 +568,16 @@ impl Animate for AnimationValue {
impl ComputeSquaredDistance for AnimationValue {
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
match *self {
% for i, prop in enumerate([p for p in data.longhands if p.animatable and p.animation_value_type == "discrete"]):
% if i > 0:
|
% endif
AnimationValue::${prop.camel_case}(..)
% endfor
=> return Err(()),
_ => (),
}
match (self, other) {
% for prop in data.longhands:
% if prop.animatable:
@ -575,10 +585,6 @@ impl ComputeSquaredDistance for AnimationValue {
(&AnimationValue::${prop.camel_case}(ref this), &AnimationValue::${prop.camel_case}(ref other)) => {
this.compute_squared_distance(other)
},
% else:
(&AnimationValue::${prop.camel_case}(_), &AnimationValue::${prop.camel_case}(_)) => {
Err(())
},
% endif
% endif
% endfor

View file

@ -40,6 +40,8 @@ packages = [
]
# Files that are ignored for all tidy and lint checks.
files = [
# Mako does not lend itself easily to splitting long lines
"./components/style/properties/helpers/animated_properties.mako.rs",
# Helper macro where actually a pseudo-element per line makes sense.
"./components/style/gecko/non_ts_pseudo_class_list.rs",
# Generated and upstream code combined with our own. Could use cleanup