mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Shrink maps if needed after stylist rebuilds
Hashbrown grows a lot sometimes making us waste a lot of memory. Shrink some of these maps after CascadeData rebuild / stylesheet collection invalidation. Differential Revision: https://phabricator.services.mozilla.com/D134716
This commit is contained in:
parent
f9610e5898
commit
fcc55f2156
6 changed files with 122 additions and 17 deletions
|
@ -170,9 +170,14 @@ impl<T> PerPseudoElementMap<T> {
|
|||
}
|
||||
|
||||
/// Get an iterator for the entries.
|
||||
pub fn iter(&self) -> ::std::slice::Iter<Option<T>> {
|
||||
pub fn iter(&self) -> std::slice::Iter<Option<T>> {
|
||||
self.entries.iter()
|
||||
}
|
||||
|
||||
/// Get a mutable iterator for the entries.
|
||||
pub fn iter_mut(&mut self) -> std::slice::IterMut<Option<T>> {
|
||||
self.entries.iter_mut()
|
||||
}
|
||||
}
|
||||
|
||||
/// Values for the :dir() pseudo class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue