diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2023-06-06 23:27:20 +0200 |
---|---|---|
committer | Oriol Brufau <obrufau@igalia.com> | 2023-06-09 10:22:25 +0200 |
commit | fcc55f2156132efeb7d127a3559d5687f4e8945d (patch) | |
tree | 5c0484349b7618f8bce967e17f92b332acaf7af7 /components/style/selector_parser.rs | |
parent | f9610e5898ee3474ad91720bc43540165e56cacd (diff) | |
download | servo-fcc55f2156132efeb7d127a3559d5687f4e8945d.tar.gz servo-fcc55f2156132efeb7d127a3559d5687f4e8945d.zip |
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
Diffstat (limited to 'components/style/selector_parser.rs')
-rw-r--r-- | components/style/selector_parser.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/style/selector_parser.rs b/components/style/selector_parser.rs index d28e333da04..f29cab9735d 100644 --- a/components/style/selector_parser.rs +++ b/components/style/selector_parser.rs @@ -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 |