Skip to content

Commit

Permalink
Merge pull request #2939 from tediou5/chore/optimising-entry-usage
Browse files Browse the repository at this point in the history
chore: optimize entry usage
  • Loading branch information
nazar-pc authored Jul 22, 2024
2 parents 111f91c + dbae792 commit 18dd43a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions crates/subspace-farmer/src/farm/plotted_pieces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,10 @@ where
piece_offset,
};

match self.pieces.entry(piece_index) {
Entry::Occupied(mut entry) => {
entry.get_mut().push(piece_details);
}
Entry::Vacant(entry) => {
entry.insert(vec![piece_details]);
}
}
self.pieces
.entry(piece_index)
.or_default()
.push(piece_details);
}
}

Expand Down

0 comments on commit 18dd43a

Please sign in to comment.