Skip to content

Commit 5347637

Browse files
committed
switch to FnvHashMap
1 parent 5120671 commit 5347637

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.2.1] - 2022-12-27
4+
5+
## Changed
6+
7+
- Internal change: switch to `FnvHashMap` for `future_queue_grouped`.
8+
39
## [0.2.0] - 2022-12-27
410

511
## Added
@@ -23,6 +29,7 @@
2329

2430
- Initial release.
2531

32+
[0.2.1]: https://github.com/nextest-rs/future-queue/releases/tag/0.2.1
2633
[0.2.0]: https://github.com/nextest-rs/future-queue/releases/tag/0.2.0
2734
[0.1.2]: https://github.com/nextest-rs/future-queue/releases/tag/0.1.2
2835
[0.1.1]: https://github.com/nextest-rs/future-queue/releases/tag/0.1.1

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ categories = ["asynchronous"]
1212
keywords = ["stream", "futures", "async", "buffer_unordered"]
1313

1414
[dependencies]
15+
fnv = "1.0.7"
1516
futures-util = { version = "0.3.25", default-features = false, features = ["std"] }
1617
pin-project-lite = "0.2.9"
1718

src/future_queue_grouped.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: MIT OR Apache-2.0
33

44
use crate::peekable_fused::PeekableFused;
5+
use fnv::FnvHashMap;
56
use futures_util::{
67
ready,
78
stream::{Fuse, FusedStream, FuturesUnordered},
@@ -10,7 +11,7 @@ use futures_util::{
1011
use pin_project_lite::pin_project;
1112
use std::{
1213
borrow::Borrow,
13-
collections::{HashMap, VecDeque},
14+
collections::VecDeque,
1415
fmt,
1516
hash::Hash,
1617
pin::Pin,
@@ -347,7 +348,7 @@ where
347348

348349
#[derive(Debug)]
349350
struct GroupStore<Q, K, Fut> {
350-
group_data: HashMap<K, GroupData<Q, Fut>>,
351+
group_data: FnvHashMap<K, GroupData<Q, Fut>>,
351352
}
352353

353354
impl<Q, K, Fut> GroupStore<Q, K, Fut>

0 commit comments

Comments
 (0)