Skip to content

Commit f77d857

Browse files
committed
record_pairs: Use rustc-hash
1 parent 74a547e commit f77d857

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Diff for: Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ indexmap = "2.7.1"
2222
mimalloc = "0.1.43"
2323
noodles = { version = "0.95.0", features = ["bam", "bgzf", "core", "gff", "sam"] }
2424
noodles-bgzf = { version = "0.37.0", features = ["libdeflate"] }
25+
rustc-hash = "2.1.1"
2526
thiserror = "2.0.11"
2627
tracing = "0.1.25"
2728
tracing-subscriber = "0.3.3"

Diff for: src/record_pairs.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@ pub mod segment_position;
22

33
pub use self::segment_position::SegmentPosition;
44

5-
use std::{
6-
collections::HashMap,
7-
io::{self, Read},
8-
};
5+
use std::io::{self, Read};
96

107
use noodles::bam;
8+
use rustc_hash::FxHashMap;
119

1210
pub struct RecordPairs<R>
1311
where
1412
R: Read,
1513
{
1614
reader: bam::io::Reader<R>,
17-
cache: HashMap<Vec<u8>, Vec<bam::Record>>,
15+
cache: FxHashMap<Vec<u8>, Vec<bam::Record>>,
1816
primary_only: bool,
1917
}
2018

@@ -25,7 +23,7 @@ where
2523
pub fn new(reader: bam::io::Reader<R>, primary_only: bool) -> Self {
2624
Self {
2725
reader,
28-
cache: HashMap::new(),
26+
cache: FxHashMap::default(),
2927
primary_only,
3028
}
3129
}

0 commit comments

Comments
 (0)