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

Use into_iter() instead of iter().cloned(). #749

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

0xekez
Copy link
Contributor

@0xekez 0xekez commented Jul 6, 2022

This ought to be a little more efficient as we don't need to clone every element as we walk the list.

Just for fun, I wrote a little benchmark for this, then ran it with a couple different sizes using hyperfine. The into_iter() method was around 1.5x as fast.

Copy link
Contributor

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you for that, very good spot :)

@ueco-jb ueco-jb merged commit b816d7d into CosmWasm:main Jul 8, 2022
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