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 memcpy instead of std::copy #2249

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions flow/Arena.h
Expand Up @@ -773,8 +773,10 @@ template <>
struct dynamic_size_traits<StringRef> : std::true_type {
template <class Context>
static size_t size(const StringRef& t, Context&) { return t.size(); }
template<class Context>
static void save(uint8_t* out, const StringRef& t, Context&) { std::copy(t.begin(), t.end(), out); }
template <class Context>
static void save(uint8_t* out, const StringRef& t, Context&) {
::memcpy(out, t.begin(), t.size());
}

template <class Context>
static void load(const uint8_t* ptr, size_t sz, StringRef& str, Context& context) {
Expand Down