mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
Bug 1398593 - stylo: mitigate performance impact of fallible allocation on stylist rebuilds. r=emilio.
This commit is contained in:
parent
61fac2c10d
commit
e7e03fac7b
2 changed files with 3 additions and 2 deletions
|
@ -1002,6 +1002,7 @@ impl<K, V, S> HashMap<K, V, S>
|
|||
self.try_entry(key).unwrap()
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn try_entry(&mut self, key: K) -> Result<Entry<K, V>, FailedAllocationError> {
|
||||
// Gotta resize now.
|
||||
self.try_reserve(1)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue