mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
style: Hash less stuff in the bloom filter, using the precomputed hashes we have.
This commit is contained in:
parent
65ebbb7c56
commit
e29b84de18
10 changed files with 129 additions and 63 deletions
|
@ -10,6 +10,7 @@ use gecko_bindings::bindings::Gecko_AddRefAtom;
|
|||
use gecko_bindings::bindings::Gecko_Atomize;
|
||||
use gecko_bindings::bindings::Gecko_ReleaseAtom;
|
||||
use gecko_bindings::structs::nsIAtom;
|
||||
use precomputed_hash::PrecomputedHash;
|
||||
use std::borrow::{Cow, Borrow};
|
||||
use std::char::{self, DecodeUtf16};
|
||||
use std::fmt::{self, Write};
|
||||
|
@ -56,6 +57,13 @@ impl Deref for Atom {
|
|||
}
|
||||
}
|
||||
|
||||
impl PrecomputedHash for Atom {
|
||||
#[inline]
|
||||
fn precomputed_hash(&self) -> u32 {
|
||||
self.get_hash()
|
||||
}
|
||||
}
|
||||
|
||||
impl Borrow<WeakAtom> for Atom {
|
||||
#[inline]
|
||||
fn borrow(&self) -> &WeakAtom {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue