diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-02-10 23:09:30 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-02-10 23:09:30 +0000 |
| commit | 790e671f6cd34fc955dfc458b0a26a20a3fd8089 (patch) | |
| tree | 2674a97bfc583fc39a4b19e8ed8da928bd8d27ce /src/shared_string.hh | |
| parent | 8714c414033cee64c6993305b0862ae9f3e88d31 (diff) | |
Replace some <cstring> function usage with c++ algorithms
Diffstat (limited to 'src/shared_string.hh')
| -rw-r--r-- | src/shared_string.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared_string.hh b/src/shared_string.hh index 0725c613..f9adf737 100644 --- a/src/shared_string.hh +++ b/src/shared_string.hh @@ -26,7 +26,7 @@ struct StringStorage : UseMemoryDomain<MemoryDomain::SharedString> const int len = (int)str.length() + (back != 0 ? 1 : 0); void* ptr = StringStorage::operator new(sizeof(StringStorage) + len + 1); StringStorage* res = reinterpret_cast<StringStorage*>(ptr); - memcpy(res->data(), str.data(), (int)str.length()); + std::copy(str.begin(), str.end(), res->data()); res->refcount = 0; res->length = len; if (back != 0) |
