mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use a BTreeMap for Document::animation_frame_list (fixes #9834)
The callbacks must stay ordered.
This commit is contained in:
parent
f7db68eff7
commit
1d87f61350
4 changed files with 66 additions and 10 deletions
|
@ -70,7 +70,7 @@ use serde::{Deserialize, Serialize};
|
|||
use smallvec::SmallVec;
|
||||
use std::boxed::FnBox;
|
||||
use std::cell::{Cell, UnsafeCell};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
use std::ffi::CString;
|
||||
use std::hash::{BuildHasher, Hash};
|
||||
use std::intrinsics::return_address;
|
||||
|
@ -246,6 +246,16 @@ impl<K, V, S> JSTraceable for HashMap<K, V, S>
|
|||
}
|
||||
}
|
||||
|
||||
impl<K: Ord + JSTraceable, V: JSTraceable> JSTraceable for BTreeMap<K, V> {
|
||||
#[inline]
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
for (k, v) in self {
|
||||
k.trace(trc);
|
||||
v.trace(trc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
|
||||
#[inline]
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue