You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2008/03/17 15:22:20 UTC

svn commit: r637897 - /stdcxx/trunk/include/string.cc

Author: faridz
Date: Mon Mar 17 07:22:20 2008
New Revision: 637897

URL: http://svn.apache.org/viewvc?rev=637897&view=rev
Log:
2008-03-17  Farid Zaripov  <fa...@epam.com>

	* include/string.cc (__replace_aux): Partially reverted
	changes for STDCXX-170 (r629550).

Modified:
    stdcxx/trunk/include/string.cc

Modified: stdcxx/trunk/include/string.cc
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/string.cc?rev=637897&r1=637896&r2=637897&view=diff
==============================================================================
--- stdcxx/trunk/include/string.cc (original)
+++ stdcxx/trunk/include/string.cc Mon Mar 17 07:22:20 2008
@@ -648,35 +648,14 @@
         }
         else {
             // Current reference has enough room.
-            pointer __tmp = 0;
-
-            if (__n2) {
-                const const_pointer __ptr =
-                    &_RWSTD_STATIC_CAST (const_reference, *__first2);
-
-                if (__s.data () <= __ptr && __s.data () + __ssize > __ptr) {
-                    const _RWSTD_SIZE_T __tmp_size = __n2 * sizeof (value_type);
-                    __tmp = _RWSTD_STATIC_CAST (pointer,
-                                                ::operator new (__tmp_size));
-                    for (__d = 0; __d < __n2; __d++)
-                        traits_type::assign (*(__tmp + __d), *__first2++);
-                }
-            }
-
             if (__rem)
                 traits_type::move (__s._C_data + __pos + __n2,
                                    __s._C_data + __pos + __n, 
                                    __rem);
 
-            if (__tmp) {
-                traits_type::copy (__s._C_data + __pos, __tmp, __n2);
-                ::operator delete (__tmp);
-            }
-            else {
-                for (__d = 0; __d < __n2; __d++)
-                    traits_type::assign (*(__s._C_data + __pos + __d),
-                                         *__first2++);
-            }
+            for (__d = 0; __d < __n2; __d++)
+                traits_type::assign (*(__s._C_data + __pos + __d),
+                                     *__first2++);
 
             __s._C_pref ()->_C_size._C_size = __len;
             traits_type::assign (__s._C_data [__len], value_type ());