mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
common: rename AHashIndexMap to AmortizedIndexMap
This commit is contained in:
parent
9e49cb0bca
commit
5176b18ef9
5 changed files with 15 additions and 14 deletions
|
|
@ -9,7 +9,7 @@ use std::time::Instant;
|
|||
|
||||
use aquatic_common::access_list::create_access_list_cache;
|
||||
use aquatic_common::access_list::AccessListArcSwap;
|
||||
use aquatic_common::AHashIndexMap;
|
||||
use aquatic_common::AmortizedIndexMap;
|
||||
use aquatic_common::CanonicalSocketAddr;
|
||||
use aquatic_common::ValidUntil;
|
||||
use crossbeam_channel::Receiver;
|
||||
|
|
@ -39,7 +39,7 @@ impl<I: Ip> Peer<I> {
|
|||
}
|
||||
}
|
||||
|
||||
type PeerMap<I> = AHashIndexMap<PeerId, Peer<I>>;
|
||||
type PeerMap<I> = AmortizedIndexMap<PeerId, Peer<I>>;
|
||||
|
||||
struct TorrentData<I: Ip> {
|
||||
pub peers: PeerMap<I>,
|
||||
|
|
@ -57,7 +57,7 @@ impl<I: Ip> Default for TorrentData<I> {
|
|||
}
|
||||
}
|
||||
|
||||
type TorrentMap<I> = AHashIndexMap<InfoHash, TorrentData<I>>;
|
||||
type TorrentMap<I> = AmortizedIndexMap<InfoHash, TorrentData<I>>;
|
||||
|
||||
#[derive(Default)]
|
||||
struct TorrentMaps {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use slab::Slab;
|
|||
use aquatic_common::access_list::create_access_list_cache;
|
||||
use aquatic_common::access_list::AccessListCache;
|
||||
use aquatic_common::ValidUntil;
|
||||
use aquatic_common::{AHashIndexMap, CanonicalSocketAddr};
|
||||
use aquatic_common::{AmortizedIndexMap, CanonicalSocketAddr};
|
||||
use aquatic_udp_protocol::*;
|
||||
use socket2::{Domain, Protocol, Socket, Type};
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ use crate::common::*;
|
|||
use crate::config::Config;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ConnectionMap(AHashIndexMap<(ConnectionId, CanonicalSocketAddr), ValidUntil>);
|
||||
pub struct ConnectionMap(AmortizedIndexMap<(ConnectionId, CanonicalSocketAddr), ValidUntil>);
|
||||
|
||||
impl ConnectionMap {
|
||||
pub fn insert(
|
||||
|
|
@ -66,7 +66,7 @@ impl PendingScrapeResponseSlab {
|
|||
request: ScrapeRequest,
|
||||
valid_until: ValidUntil,
|
||||
) -> impl IntoIterator<Item = (RequestWorkerIndex, PendingScrapeRequest)> {
|
||||
let mut split_requests: AHashIndexMap<RequestWorkerIndex, PendingScrapeRequest> =
|
||||
let mut split_requests: AmortizedIndexMap<RequestWorkerIndex, PendingScrapeRequest> =
|
||||
Default::default();
|
||||
|
||||
if request.info_hashes.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue