mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Rewrite text and inline fragment handling during flow
construction to avoid cloning and moving flows so much. Besides amounting to a 5%-10% win on a page with a lot of text, this simplifies and refactors the text layout code.
This commit is contained in:
parent
d8cb901f6a
commit
bb6f557276
11 changed files with 341 additions and 322 deletions
|
@ -49,6 +49,13 @@ impl<K: Clone + PartialEq + Eq + Hash, V: Clone> Cache<K,V> for HashCache<K,V> {
|
|||
fn evict_all(&mut self) {
|
||||
self.entries.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl<K,V> HashCache<K,V> where K: Clone + PartialEq + Eq + Hash, V: Clone {
|
||||
pub fn find_equiv<'a,Q>(&'a self, key: &Q) -> Option<&'a V> where Q: Hash + Equiv<K> {
|
||||
self.entries.find_equiv(key)
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue