Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

use copy_from_slice instead of for loop #5647

Merged
merged 1 commit into from
May 18, 2017

Conversation

guanqun
Copy link
Contributor

@guanqun guanqun commented May 17, 2017

According to the doc here: https://doc.rust-lang.org/std/primitive.slice.html#method.copy_from_slice

It will use memcpy under the hood, so I think it has slightly better performance.

@tomusdrw tomusdrw added A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust. labels May 18, 2017
@gavofyork gavofyork merged commit 6d81b8a into openethereum:master May 18, 2017
@rphmeier
Copy link
Contributor

in general, LLVM will lift simple loops like this to memcpy/memmove, but this also gives a readability bonus. thanks!

@guanqun guanqun deleted the copy_slice branch May 18, 2017 14:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants