stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r671643 - /stdcxx/branches/4.2.x/include/string.cc
Date Wed, 25 Jun 2008 19:55:41 GMT
Author: vitek
Date: Wed Jun 25 12:55:41 2008
New Revision: 671643

URL: http://svn.apache.org/viewvc?rev=671643&view=rev
Log:
2008-06-25  Travis Vitek  <vitek@roguewave.com>

	STDCXX-170
	* include/string.cc: Revert r669747.

Modified:
    stdcxx/branches/4.2.x/include/string.cc

Modified: stdcxx/branches/4.2.x/include/string.cc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/string.cc?rev=671643&r1=671642&r2=671643&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/string.cc (original)
+++ stdcxx/branches/4.2.x/include/string.cc Wed Jun 25 12:55:41 2008
@@ -34,7 +34,6 @@
 #  pragma warning (disable: 4345)
 #endif   // _RWSTD_MSVC
 
-#include <rw/_typetraits.h>
 
 _RWSTD_NAMESPACE (std) {
 
@@ -478,7 +477,6 @@
     typedef _TYPENAME traits_type::char_type      value_type;
     typedef _Alloc                                allocator_type;
     typedef _TYPENAME allocator_type::size_type   size_type;
-    typedef _TYPENAME allocator_type::const_pointer     const_pointer;
 
     typedef _STD::basic_string<_CharT, _Traits, _Alloc> _C_string_type;
 
@@ -515,30 +513,10 @@
         return __s.replace (__pos, __n, size_type (), value_type ());
     }
 
-    if (_RW::__rw_is_pointer<_InputIter>::_C_val) {
-        const const_pointer __beg1 = __s.data ();
-        const const_pointer __end1 = __s.data () + __s.size ();
-
-        const const_pointer __beg2 =
-            _RWSTD_REINTERPRET_CAST (const_pointer, &*__first2);
-        const const_pointer __end2 = 
-            _RWSTD_REINTERPRET_CAST (const_pointer, &*__last2);
-
-        // ranges don't overlap, do simple replace
-        if (__end1 < __beg2 || __end2 < __beg1)
-            return __s.__replace_aux (__first1, __last1, __first2, __last2);
-
-        // otherwise fall through and make a copy first
-    }
-
      // use a (probably) faster algorithm if possible
     if (_STD::__is_bidirectional_iterator (_RWSTD_ITERATOR_CATEGORY(_InputIter,
-                                                                    __last2))) {
-        _C_string_type __s3;
-        __s3.__replace_aux (__s3.begin (), __s3.begin (), __first2, __last2);
-
-        return __s.__replace_aux (__first1, __last1, __s3.begin (), __s3.end ());
-    }
+                                                                    __last2)))
+        return __s.__replace_aux (__first1, __last1, __first2, __last2);
 
     _C_string_type __s3;
     _TYPENAME _C_string_type::iterator __first3 = __s3.begin ();
@@ -618,8 +596,6 @@
 
 #  endif  // _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
 
-    // assumes that the two ranges do not overlap
-
     _RWSTD_ASSERT_RANGE (__first1, __s._C_make_iter (__s._C_data 
                                                      + __s.size ()));
     _RWSTD_ASSERT_RANGE (__first1, __last1);



Mime
View raw message