Skip to content

Commit

Permalink
performance tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGuarracino committed Jan 3, 2025
1 parent 6c5a3b8 commit b14d1e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/impg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ impl Impg {
.map(|(&k, v)| (k, (*v).clone()))
.collect()
} else {
FxHashMap::default()
FxHashMap::with_capacity_and_hasher(self.seq_index.len(), Default::default())
};
// Initialize first visited range for target_id if not already present
visited_ranges.entry(target_id)
.or_default()
.insert((range_start, range_end));

while let Some((current_target_id, current_target_start, current_target_end)) = stack.pop() {
while let Some((current_target_id, current_target_start, current_target_end)) = stack.pop() {
if let Some(tree) = self.trees.get(&current_target_id) {
tree.query(current_target_start, current_target_end, |interval| {
let metadata = &interval.metadata;
Expand Down

0 comments on commit b14d1e2

Please sign in to comment.