Skip to content

Commit

Permalink
chore: optimize entry usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tedious committed Jul 22, 2024
1 parent 111f91c commit dbae792
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 dbae792

Please sign in to comment.