mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove 5k from AnimationValue::compute_squared_distance.
This commit is contained in:
parent
799014755e
commit
01c35f99cd
2 changed files with 12 additions and 4 deletions
|
@ -568,6 +568,16 @@ impl Animate for AnimationValue {
|
||||||
|
|
||||||
impl ComputeSquaredDistance for AnimationValue {
|
impl ComputeSquaredDistance for AnimationValue {
|
||||||
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
|
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) {
|
match (self, other) {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands:
|
||||||
% if prop.animatable:
|
% if prop.animatable:
|
||||||
|
@ -575,10 +585,6 @@ impl ComputeSquaredDistance for AnimationValue {
|
||||||
(&AnimationValue::${prop.camel_case}(ref this), &AnimationValue::${prop.camel_case}(ref other)) => {
|
(&AnimationValue::${prop.camel_case}(ref this), &AnimationValue::${prop.camel_case}(ref other)) => {
|
||||||
this.compute_squared_distance(other)
|
this.compute_squared_distance(other)
|
||||||
},
|
},
|
||||||
% else:
|
|
||||||
(&AnimationValue::${prop.camel_case}(_), &AnimationValue::${prop.camel_case}(_)) => {
|
|
||||||
Err(())
|
|
||||||
},
|
|
||||||
% endif
|
% endif
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -40,6 +40,8 @@ packages = [
|
||||||
]
|
]
|
||||||
# Files that are ignored for all tidy and lint checks.
|
# Files that are ignored for all tidy and lint checks.
|
||||||
files = [
|
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.
|
# Helper macro where actually a pseudo-element per line makes sense.
|
||||||
"./components/style/gecko/non_ts_pseudo_class_list.rs",
|
"./components/style/gecko/non_ts_pseudo_class_list.rs",
|
||||||
# Generated and upstream code combined with our own. Could use cleanup
|
# Generated and upstream code combined with our own. Could use cleanup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue