mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: remove selector_map::find_push.
It has a single caller and is overly generic, which is going to make harder to add fallible allocations to it.
This commit is contained in:
parent
c0c43da1f9
commit
0a1a134050
1 changed files with 4 additions and 10 deletions
|
@ -299,7 +299,10 @@ impl<T: SelectorMapEntry> SelectorMap<T> {
|
|||
// rulehash lookup may produce superfluous selectors, but the
|
||||
// subsequent selector matching work will filter them out.
|
||||
if name != lower_name {
|
||||
find_push(&mut self.local_name_hash, lower_name.clone(), entry.clone());
|
||||
self.local_name_hash
|
||||
.entry(lower_name.clone())
|
||||
.or_insert_with(SmallVec::new)
|
||||
.push(entry.clone());
|
||||
}
|
||||
self.local_name_hash
|
||||
.entry(name.clone())
|
||||
|
@ -485,15 +488,6 @@ fn find_bucket<'a>(mut iter: SelectorIter<'a, SelectorImpl>) -> Bucket<'a> {
|
|||
return current_bucket
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn find_push<Str: Eq + Hash, V, VL>(map: &mut PrecomputedHashMap<Str, VL>,
|
||||
key: Str,
|
||||
value: V)
|
||||
where VL: VecLike<V> + Default
|
||||
{
|
||||
map.entry(key).or_insert_with(VL::default).push(value)
|
||||
}
|
||||
|
||||
/// Wrapper for PrecomputedHashMap that does ASCII-case-insensitive lookup in quirks mode.
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue