use identity hash function

This commit is contained in:
Toshit Chawda 2024-08-31 16:29:44 -07:00
parent 9cd87b7243
commit b70f91f90a
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
3 changed files with 13 additions and 4 deletions

View file

@ -1,17 +1,18 @@
use std::{
collections::HashMap,
sync::{
atomic::{AtomicBool, AtomicU32, Ordering},
Arc,
},
};
use crate::{
extensions::AnyProtocolExtension,
ws::{Frame, LockedWebSocketWrite, OpCode, Payload, WebSocketRead},
AtomicCloseReason, ClosePacket, CloseReason, ConnectPacket, MuxStream, Packet, PacketType,
Role, StreamType, WispError,
};
use nohash_hasher::IntMap;
use bytes::{Bytes, BytesMut};
use event_listener::Event;
use flume as mpsc;
@ -51,7 +52,7 @@ pub struct MuxInner<R: WebSocketRead + Send> {
fut_tx: mpsc::Sender<WsEvent>,
fut_exited: Arc<AtomicBool>,
stream_map: HashMap<u32, MuxMapValue>,
stream_map: IntMap<u32, MuxMapValue>,
buffer_size: u32,
target_buffer_size: u32,
@ -91,7 +92,7 @@ impl<R: WebSocketRead + Send> MuxInner<R> {
role: Role::Server,
stream_map: HashMap::new(),
stream_map: IntMap::default(),
server_tx,
},
@ -127,7 +128,7 @@ impl<R: WebSocketRead + Send> MuxInner<R> {
role: Role::Client,
stream_map: HashMap::new(),
stream_map: IntMap::default(),
server_tx,
},