Permalink
Browse files

Merge "Use memmove instead of memcpy in string::assign."

  • Loading branch information...
2 parents a4b9a71 + 236ba45 commit b6fd8889b029faa2bd8a14c11b38aa07755e1ef0 @kruton kruton committed with Android (Google) Code Review Jul 15, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 stlport/stl/_string.c
View
@@ -242,11 +242,11 @@ basic_string<_CharT,_Traits,_Alloc>&
basic_string<_CharT,_Traits,_Alloc>::_M_assign(const _CharT* __f, const _CharT* __l) {
ptrdiff_t __n = __l - __f;
if (__STATIC_CAST(size_type, __n) <= size()) {
- _Traits::copy(this->_M_Start(), __f, __n);
+ _Traits::move(this->_M_Start(), __f, __n);
erase(begin() + __n, end());
}
else {
- _Traits::copy(this->_M_Start(), __f, size());
+ _Traits::move(this->_M_Start(), __f, size());
_M_append(__f + size(), __l);
}
return *this;

0 comments on commit b6fd888

Please sign in to comment.