mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Use regular (ahash) IndexMap for PeerMaps
This commit is contained in:
parent
5f0971e952
commit
c76d7442e2
7 changed files with 16 additions and 8 deletions
|
|
@ -24,6 +24,7 @@ duplicate = "0.4"
|
|||
git-testament = "0.2"
|
||||
hashbrown = "0.12"
|
||||
hex = "0.4"
|
||||
indexmap = "1"
|
||||
indexmap-amortized = "1"
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ pub mod privileges;
|
|||
#[cfg(feature = "rustls")]
|
||||
pub mod rustls_config;
|
||||
|
||||
/// IndexMap using AHash hasher
|
||||
pub type IndexMap<K, V> = indexmap::IndexMap<K, V, RandomState>;
|
||||
|
||||
/// Amortized IndexMap using AHash hasher
|
||||
pub type AmortizedIndexMap<K, V> = indexmap_amortized::IndexMap<K, V, RandomState>;
|
||||
|
||||
|
|
@ -104,7 +107,7 @@ impl Drop for PanicSentinel {
|
|||
#[inline]
|
||||
pub fn extract_response_peers<K, V, R, F>(
|
||||
rng: &mut impl Rng,
|
||||
peer_map: &AmortizedIndexMap<K, V>,
|
||||
peer_map: &IndexMap<K, V>,
|
||||
max_num_peers_to_take: usize,
|
||||
sender_peer_map_key: K,
|
||||
peer_conversion_function: F,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue