Use Fx* variants of HashMap and HashSet everywhere in Zed (#7481)
Release Notes: - N/A
This commit is contained in:
parent
7939673a7d
commit
eb236302c2
27 changed files with 96 additions and 102 deletions
|
@ -2,7 +2,7 @@ use crate::{
|
|||
AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style,
|
||||
WindowContext,
|
||||
};
|
||||
use collections::{FxHashMap, FxHashSet};
|
||||
use collections::{HashMap, HashSet};
|
||||
use smallvec::SmallVec;
|
||||
use std::fmt::Debug;
|
||||
use taffy::{
|
||||
|
@ -17,11 +17,11 @@ type NodeMeasureFn =
|
|||
|
||||
pub struct TaffyLayoutEngine {
|
||||
taffy: Taffy,
|
||||
styles: FxHashMap<LayoutId, Style>,
|
||||
children_to_parents: FxHashMap<LayoutId, LayoutId>,
|
||||
absolute_layout_bounds: FxHashMap<LayoutId, Bounds<Pixels>>,
|
||||
computed_layouts: FxHashSet<LayoutId>,
|
||||
nodes_to_measure: FxHashMap<LayoutId, NodeMeasureFn>,
|
||||
styles: HashMap<LayoutId, Style>,
|
||||
children_to_parents: HashMap<LayoutId, LayoutId>,
|
||||
absolute_layout_bounds: HashMap<LayoutId, Bounds<Pixels>>,
|
||||
computed_layouts: HashSet<LayoutId>,
|
||||
nodes_to_measure: HashMap<LayoutId, NodeMeasureFn>,
|
||||
}
|
||||
|
||||
static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by construction if possible";
|
||||
|
@ -30,11 +30,11 @@ impl TaffyLayoutEngine {
|
|||
pub fn new() -> Self {
|
||||
TaffyLayoutEngine {
|
||||
taffy: Taffy::new(),
|
||||
styles: FxHashMap::default(),
|
||||
children_to_parents: FxHashMap::default(),
|
||||
absolute_layout_bounds: FxHashMap::default(),
|
||||
computed_layouts: FxHashSet::default(),
|
||||
nodes_to_measure: FxHashMap::default(),
|
||||
styles: HashMap::default(),
|
||||
children_to_parents: HashMap::default(),
|
||||
absolute_layout_bounds: HashMap::default(),
|
||||
computed_layouts: HashSet::default(),
|
||||
nodes_to_measure: HashMap::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue