Use Fx* variants of HashMap and HashSet everywhere in Zed (#7481)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-02-07 09:45:37 +02:00 committed by GitHub
parent 7939673a7d
commit eb236302c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 96 additions and 102 deletions

View file

@ -1,5 +1,5 @@
use crate::{px, EntityId, FontId, GlyphId, Pixels, PlatformTextSystem, Point, Size};
use collections::{FxHashMap, FxHashSet};
use collections::{HashMap, HashSet};
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
use smallvec::SmallVec;
use std::{
@ -277,10 +277,10 @@ impl WrappedLineLayout {
pub(crate) struct LineLayoutCache {
view_stack: Mutex<Vec<EntityId>>,
previous_frame: Mutex<FxHashMap<CacheKey, Arc<LineLayout>>>,
current_frame: RwLock<FxHashMap<CacheKey, Arc<LineLayout>>>,
previous_frame_wrapped: Mutex<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>,
current_frame_wrapped: RwLock<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>,
previous_frame: Mutex<HashMap<CacheKey, Arc<LineLayout>>>,
current_frame: RwLock<HashMap<CacheKey, Arc<LineLayout>>>,
previous_frame_wrapped: Mutex<HashMap<CacheKey, Arc<WrappedLineLayout>>>,
current_frame_wrapped: RwLock<HashMap<CacheKey, Arc<WrappedLineLayout>>>,
platform_text_system: Arc<dyn PlatformTextSystem>,
}
@ -296,7 +296,7 @@ impl LineLayoutCache {
}
}
pub fn finish_frame(&self, reused_views: &FxHashSet<EntityId>) {
pub fn finish_frame(&self, reused_views: &HashSet<EntityId>) {
debug_assert_eq!(self.view_stack.lock().len(), 0);
let mut prev_frame = self.previous_frame.lock();