mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Removed FnvHash and transformed the rest to FxHashmap (#39233)
This should be the final PR for the Hash Function series that is trivial. Of note: I decided to transform `HashMapTracedValues<Atom,..>` to use FxBuildHasher. This is likely not going to improve performance as Atom's already have a unique u32 that is used as the Hash but it safes a few bytes for the RandomState that is normally in the HashMap. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Testing: Hash function changes should not change functionality, we slightly decrease the size and unit tests still work. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
726b456120
commit
84465e7768
55 changed files with 211 additions and 202 deletions
|
@ -5,8 +5,8 @@
|
|||
use base::id::{BrowsingContextId, PipelineId};
|
||||
use embedder_traits::{InputEvent, MouseLeftViewportEvent, Theme};
|
||||
use euclid::Point2D;
|
||||
use fnv::FnvHashMap;
|
||||
use log::warn;
|
||||
use rustc_hash::FxHashMap;
|
||||
use script_traits::{ConstellationInputEvent, ScriptThreadMessage};
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
|
@ -63,7 +63,7 @@ impl ConstellationWebView {
|
|||
fn target_pipeline_id_for_input_event(
|
||||
&self,
|
||||
event: &ConstellationInputEvent,
|
||||
browsing_contexts: &FnvHashMap<BrowsingContextId, BrowsingContext>,
|
||||
browsing_contexts: &FxHashMap<BrowsingContextId, BrowsingContext>,
|
||||
) -> Option<PipelineId> {
|
||||
if let Some(hit_test_result) = &event.hit_test_result {
|
||||
return Some(hit_test_result.pipeline_id);
|
||||
|
@ -84,8 +84,8 @@ impl ConstellationWebView {
|
|||
pub(crate) fn forward_input_event(
|
||||
&mut self,
|
||||
event: ConstellationInputEvent,
|
||||
pipelines: &FnvHashMap<PipelineId, Pipeline>,
|
||||
browsing_contexts: &FnvHashMap<BrowsingContextId, BrowsingContext>,
|
||||
pipelines: &FxHashMap<PipelineId, Pipeline>,
|
||||
browsing_contexts: &FxHashMap<BrowsingContextId, BrowsingContext>,
|
||||
) {
|
||||
let Some(pipeline_id) = self.target_pipeline_id_for_input_event(&event, browsing_contexts)
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue