mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
layout: animation: hoist down precise_time_s() call to avoid calling it unnecessarily
This was here before, but I moved it up presumably in one of my attempts and never forgot to restore that.
This commit is contained in:
parent
f149d4d577
commit
f54583884e
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,6 @@ pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
|
||||||
expired_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
|
expired_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
|
||||||
new_animations_receiver: &Receiver<Animation>,
|
new_animations_receiver: &Receiver<Animation>,
|
||||||
pipeline_id: PipelineId) {
|
pipeline_id: PipelineId) {
|
||||||
let now = time::precise_time_s();
|
|
||||||
let mut new_running_animations = vec![];
|
let mut new_running_animations = vec![];
|
||||||
while let Ok(animation) = new_animations_receiver.try_recv() {
|
while let Ok(animation) = new_animations_receiver.try_recv() {
|
||||||
let should_push = match animation {
|
let should_push = match animation {
|
||||||
|
@ -69,6 +68,7 @@ pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let now = time::precise_time_s();
|
||||||
// Expire old running animations.
|
// Expire old running animations.
|
||||||
let mut keys_to_remove = vec![];
|
let mut keys_to_remove = vec![];
|
||||||
for (key, running_animations) in running_animations.iter_mut() {
|
for (key, running_animations) in running_animations.iter_mut() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue