зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #18428 - style: remove selector_map::find_push (from emilio:find-push); r=nox
It has a single caller and is overly generic, which is going to make harder to add fallible allocations to it. Source-Repo: https://github.com/servo/servo Source-Revision: 91b748ec22a952063c9e00870d4a788bc3799a18 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 9b379ada6e8b024f4300f5919f1b6ed29281ddcd
This commit is contained in:
Родитель
95da87767f
Коммит
639cb4fa0f
|
@ -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))]
|
||||
|
|
Загрузка…
Ссылка в новой задаче