Use regular (ahash) IndexMap for PeerMaps

This commit is contained in:
Joakim Frostegård 2022-08-06 16:50:56 +02:00
parent 5f0971e952
commit c76d7442e2
7 changed files with 16 additions and 8 deletions

View file

@ -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"

View file

@ -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,