Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: remove unnecessary draining of changes to be applied #80

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

gterzian
Copy link

@gterzian gterzian commented Apr 1, 2021

A few nits, caught my attention when looking at #78

actor: Option<(amp::ActorId, u64)>,
) -> Result<amp::Patch, AutomergeError> {
let mut pending_diffs = HashMap::new();

for change in changes.drain(..) {
for change in changes.into_iter() {
Copy link
Author

@gterzian gterzian Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here using drain would have made a lot of sense if you had a mutable reference to the vector, and that after the changes had been applied, you expected the caller to still use the now empty one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants