summaryrefslogtreecommitdiffstats
path: root/winit/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-01 11:59:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-01 12:00:15 +0200
commitf5bcfec8211c04c4b05f63d01d52d3e5d2cc123e (patch)
tree4a9f0699548cea15b43743dcf00d5628890610ab /winit/src
parent14ed71e09b648693dfca9eb29f14147c5c03a6bc (diff)
downloadiced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.tar.gz
iced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.tar.bz2
iced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.zip
Use `rustc-hash` for most of our `HashMap` and `HashSet` instances
Diffstat (limited to 'winit/src')
-rw-r--r--winit/src/multi_window.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs
index b4c25411..e17cc180 100644
--- a/winit/src/multi_window.rs
+++ b/winit/src/multi_window.rs
@@ -27,7 +27,7 @@ use crate::{Clipboard, Error, Proxy, Settings};
pub use crate::application::{default, Appearance, DefaultStyle};
-use std::collections::HashMap;
+use rustc_hash::FxHashMap;
use std::mem::ManuallyDrop;
use std::sync::Arc;
use std::time::Instant;
@@ -381,12 +381,12 @@ async fn run_instance<A, E, C>(
)]
};
- let mut ui_caches = HashMap::new();
+ let mut ui_caches = FxHashMap::default();
let mut user_interfaces = ManuallyDrop::new(build_user_interfaces(
&application,
&mut debug,
&mut window_manager,
- HashMap::from_iter([(
+ FxHashMap::from_iter([(
window::Id::MAIN,
user_interface::Cache::default(),
)]),
@@ -759,7 +759,7 @@ async fn run_instance<A, E, C>(
// TODO mw application update returns which window IDs to update
if !messages.is_empty() || uis_stale {
- let mut cached_interfaces: HashMap<
+ let mut cached_interfaces: FxHashMap<
window::Id,
user_interface::Cache,
> = ManuallyDrop::into_inner(user_interfaces)
@@ -849,7 +849,7 @@ fn update<A: Application, C, E: Executor>(
debug: &mut Debug,
messages: &mut Vec<A::Message>,
window_manager: &mut WindowManager<A, C>,
- ui_caches: &mut HashMap<window::Id, user_interface::Cache>,
+ ui_caches: &mut FxHashMap<window::Id, user_interface::Cache>,
) where
C: Compositor<Renderer = A::Renderer> + 'static,
A::Theme: DefaultStyle,
@@ -890,7 +890,7 @@ fn run_command<A, C, E>(
proxy: &mut winit::event_loop::EventLoopProxy<A::Message>,
debug: &mut Debug,
window_manager: &mut WindowManager<A, C>,
- ui_caches: &mut HashMap<window::Id, user_interface::Cache>,
+ ui_caches: &mut FxHashMap<window::Id, user_interface::Cache>,
) where
A: Application,
E: Executor,
@@ -1218,8 +1218,8 @@ pub fn build_user_interfaces<'a, A: Application, C: Compositor>(
application: &'a A,
debug: &mut Debug,
window_manager: &mut WindowManager<A, C>,
- mut cached_user_interfaces: HashMap<window::Id, user_interface::Cache>,
-) -> HashMap<window::Id, UserInterface<'a, A::Message, A::Theme, A::Renderer>>
+ mut cached_user_interfaces: FxHashMap<window::Id, user_interface::Cache>,
+) -> FxHashMap<window::Id, UserInterface<'a, A::Message, A::Theme, A::Renderer>>
where
C: Compositor<Renderer = A::Renderer>,
A::Theme: DefaultStyle,