mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +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
|
@ -2,7 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
@ -11,6 +10,7 @@ use embedder_traits::{MouseButtonAction, WebDriverCommandMsg, WebDriverScriptCom
|
|||
use ipc_channel::ipc;
|
||||
use keyboard_types::webdriver::KeyInputState;
|
||||
use log::{error, info};
|
||||
use rustc_hash::FxHashSet;
|
||||
use webdriver::actions::{
|
||||
ActionSequence, ActionsType, GeneralAction, KeyAction, KeyActionItem, KeyDownAction,
|
||||
KeyUpAction, NullActionItem, PointerAction, PointerActionItem, PointerDownAction,
|
||||
|
@ -64,7 +64,7 @@ pub(crate) enum InputSourceState {
|
|||
#[allow(dead_code)]
|
||||
pub(crate) struct PointerInputState {
|
||||
subtype: PointerType,
|
||||
pressed: HashSet<u64>,
|
||||
pressed: FxHashSet<u64>,
|
||||
x: f64,
|
||||
y: f64,
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ impl PointerInputState {
|
|||
pub fn new(subtype: PointerType) -> PointerInputState {
|
||||
PointerInputState {
|
||||
subtype,
|
||||
pressed: HashSet::new(),
|
||||
pressed: FxHashSet::default(),
|
||||
x: 0.0,
|
||||
y: 0.0,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue