Author: sebor
Date: Tue Aug 7 14:16:18 2007
New Revision: 563660
URL: http://svn.apache.org/viewvc?view=rev&rev=563660
Log:
2007-08-07 Martin Sebor <[EMAIL PROTECTED]>
* vector.cc (__rw_insert_range): Used predecrement even with pointers
instead of preincrement for efficiency when pointer is a user-defined
type.
Modified:
incubator/stdcxx/trunk/include/vector.cc
Modified: incubator/stdcxx/trunk/include/vector.cc
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/vector.cc?view=diff&rev=563660&r1=563659&r2=563660
==============================================================================
--- incubator/stdcxx/trunk/include/vector.cc (original)
+++ incubator/stdcxx/trunk/include/vector.cc Tue Aug 7 14:16:18 2007
@@ -111,9 +111,10 @@
{
_RWSTD_ASSERT_RANGE (__first, end ());
- for (size_type __n = end () - __first; !(0 == __n); --__n) {
- _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, destroy (--_C_end));
- }
+ _C_value_alloc_type __alloc = _RWSTD_VALUE_ALLOC_CAST (*this);
+
+ for (size_type __n = end () - __first; !(0 == __n); --__n)
+ __alloc.destroy (--_C_end);
}
@@ -650,8 +651,10 @@
__self->_C_push_back (*__p);
// over the range of elements moved above
- for (pointer __q = __end; __movend < __q--; )
+ for (pointer __q = __end; __movend < __q; ) {
+ --__q;
*__q = *(__q - __size2);
+ }
}
else {
// compute the length of the initial subsequence of the range