Skip to content

Commit

Permalink
feat: VectorDiff::apply uses Vector::append on VectorDiff::Append.
Browse files Browse the repository at this point in the history
Using `Vector::extend` will push back each value from `values`
individually in a loop. However, this patch changes that to use
`Vector::append` which appends all values at once. It's probably more
optimised.
  • Loading branch information
Hywan authored and jplatte committed Jan 14, 2025
1 parent 0763f9c commit ab55051
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eyeball-im/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl<T: Clone> VectorDiff<T> {
pub fn apply(self, vec: &mut Vector<T>) {
match self {
VectorDiff::Append { values } => {
vec.extend(values);
vec.append(values);
}
VectorDiff::Clear => {
vec.clear();
Expand Down

0 comments on commit ab55051

Please sign in to comment.