From 790e671f6cd34fc955dfc458b0a26a20a3fd8089 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 10 Feb 2015 23:09:30 +0000 Subject: Replace some function usage with c++ algorithms --- src/shared_string.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared_string.hh') 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 const int len = (int)str.length() + (back != 0 ? 1 : 0); void* ptr = StringStorage::operator new(sizeof(StringStorage) + len + 1); StringStorage* res = reinterpret_cast(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) -- cgit v1.2.3