Skip to content

Commit 18dd43a

Browse files
authored
Merge pull request #2939 from tediou5/chore/optimising-entry-usage
chore: optimize entry usage
2 parents 111f91c + dbae792 commit 18dd43a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

crates/subspace-farmer/src/farm/plotted_pieces.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,10 @@ where
114114
piece_offset,
115115
};
116116

117-
match self.pieces.entry(piece_index) {
118-
Entry::Occupied(mut entry) => {
119-
entry.get_mut().push(piece_details);
120-
}
121-
Entry::Vacant(entry) => {
122-
entry.insert(vec![piece_details]);
123-
}
124-
}
117+
self.pieces
118+
.entry(piece_index)
119+
.or_default()
120+
.push(piece_details);
125121
}
126122
}
127123

0 commit comments

Comments
 (0)