aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-10-28 11:24:41 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-10-28 11:34:06 -0700
commita94e13f8886211b2ead8d52b3cfe43cd0c8ff998 (patch)
treebb1fe4c2d2f530373e4ea1abde42be67e4376d5d /components/script/dom/bindings
parent8ab354ac085d8d70d7ccf992b5262e1969e3949a (diff)
downloadservo-a94e13f8886211b2ead8d52b3cfe43cd0c8ff998.tar.gz
servo-a94e13f8886211b2ead8d52b3cfe43cd0c8ff998.zip
script: Use an FNV hash to hash event listeners.
The security properties of SipHash are irrelevant for event listeners and the creation of the random number generator was showing up high in the profiles.
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r--components/script/dom/bindings/trace.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 930fd59edbe..c4f59491c57 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -39,7 +39,7 @@ use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
use net::image_cache_task::ImageCacheTask;
use script_traits::ScriptControlChan;
use std::collections::hashmap::HashMap;
-use collections::hash::Hash;
+use collections::hash::{Hash, Hasher};
use style::PropertyDeclarationBlock;
use std::comm::{Receiver, Sender};
use string_cache::{Atom, Namespace};
@@ -170,7 +170,9 @@ impl<T: JSTraceable> JSTraceable for Option<T> {
}
}
-impl<K: Eq+Hash+JSTraceable, V: JSTraceable> JSTraceable for HashMap<K, V> {
+impl<K,V,S,H> JSTraceable for HashMap<K, V, H> where K: Eq + Hash<S> + JSTraceable,
+ V: JSTraceable,
+ H: Hasher<S> {
#[inline]
fn trace(&self, trc: *mut JSTracer) {
for e in self.iter() {