Replace the SmallVec by a Vec

This commit is contained in:
Clément Renault 2024-07-21 18:22:50 +02:00
parent 56329633d5
commit 91ec0bdaf4
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -295,8 +295,8 @@ impl<K: Eq + Hash + Clone, V> ArcCache<K, V> {
(self.frequent_set.get_mut(k), evicted) (self.frequent_set.get_mut(k), evicted)
} }
pub fn push(&mut self, k: K, v: V) -> SmallVec<[(K, V); 2]> { pub fn push(&mut self, k: K, v: V) -> Vec<(K, V)> {
let mut evicted = SmallVec::new(); let mut evicted = Vec::new();
if self.frequent_set.contains(&k) { if self.frequent_set.contains(&k) {
if let Some(evicted_entry) = self.frequent_set.push(k, v) { if let Some(evicted_entry) = self.frequent_set.push(k, v) {