2008-05-15 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
authorAndreas N <andreas@mono-cvs.ximian.com>
Thu, 15 May 2008 22:16:16 +0000 (22:16 -0000)
committerAndreas N <andreas@mono-cvs.ximian.com>
Thu, 15 May 2008 22:16:16 +0000 (22:16 -0000)
* StringBuilder.cs: Resubmit uncritical parts of String cleanup patch

svn path=/trunk/mcs/; revision=103327

mcs/class/corlib/System.Text/ChangeLog
mcs/class/corlib/System.Text/StringBuilder.cs

index 464acc88d0afbde1aa313a221880ef311562ddb6..6b2a683ca23c06ec59cd46d9615682c9fffb68bc 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-15  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+       * StringBuilder.cs: Resubmit uncritical parts of String cleanup patch
+
 2008-04-09  Atsushi Enomoto  <atsushi@ximian.com>
 
        * UTF7Encoding.cs :
index 1136ef51016c15b75868baedc5325e6b98908e48..f9ff5c3425936f6e0e6a9de7c0702adc281a4977 100644 (file)
@@ -86,7 +86,7 @@ namespace System.Text {
 
                        _str = String.InternalAllocateStr ((length > capacity) ? length : capacity);
                        if (length > 0)
-                               String.InternalStrcpy(_str, 0, value, startIndex, length);
+                               String.CharCopy (_str, 0, value, startIndex, length);
                        
                        _length = length;
                }
@@ -258,7 +258,7 @@ namespace System.Text {
                        // Copy everything after the 'removed' part to the start 
                        // of the removed part and truncate the sLength
                        if (_length - (startIndex + length) > 0)
-                               String.InternalStrcpy (_str, startIndex, _str, startIndex + length, _length - (startIndex + length));
+                               String.CharCopy (_str, startIndex, _str, startIndex + length, _length - (startIndex + length));
 
                        _length -= length;
 
@@ -309,8 +309,8 @@ namespace System.Text {
 
                        string end = _str.Substring (startIndex + count, _length - startIndex - count );
 
-                       String.InternalStrcpy (_str, startIndex, replace);
-                       String.InternalStrcpy (_str, startIndex + replace.Length, end);
+                       String.CharCopy (_str, startIndex, replace, 0, replace.Length);
+                       String.CharCopy (_str, startIndex + replace.Length, end, 0, end.Length);
                        
                        _length = replace.Length + (_length - count);
 
@@ -328,7 +328,7 @@ namespace System.Text {
                        if (null != _cached_str || _str.Length < needed_cap)
                                InternalEnsureCapacity (needed_cap);
                        
-                       String.InternalStrcpy (_str, _length, value);
+                       String.CharCopy (_str, _length, value, 0, value.Length);
                        _length = needed_cap;
 
                        return this;
@@ -349,7 +349,7 @@ namespace System.Text {
                        if (null != _cached_str || _str.Length < needed_cap)
                                InternalEnsureCapacity (needed_cap);
 
-                       String.InternalStrcpy (_str, _length, value);
+                       String.CharCopy (_str, _length, value, 0, value.Length);
                        _length = needed_cap;
                        return this;
                }
@@ -453,7 +453,7 @@ namespace System.Text {
                        int needed_cap = _length + charCount;
                        InternalEnsureCapacity (needed_cap);
 
-                       String.InternalStrcpy (_str, _length, value, startIndex, charCount);
+                       String.CharCopy (_str, _length, value, startIndex, charCount);
                        _length = needed_cap;
 
                        return this;
@@ -475,7 +475,7 @@ namespace System.Text {
                        if (null != _cached_str || _str.Length < needed_cap)
                                InternalEnsureCapacity (needed_cap);
 
-                       String.InternalStrcpy (_str, _length, value, startIndex, count);
+                       String.CharCopy (_str, _length, value, startIndex, count);
                        
                        _length = needed_cap;
 
@@ -557,10 +557,10 @@ namespace System.Text {
                        InternalEnsureCapacity (_length + value.Length);
 
                        // Move everything to the right of the insert point across
-                       String.InternalStrcpy (_str, index + value.Length, _str, index, _length - index);
+                       String.CharCopyReverse (_str, index + value.Length, _str, index, _length - index);
                        
                        // Copy in stuff from the insert buffer
-                       String.InternalStrcpy (_str, index, value);
+                       String.CharCopy (_str, index, value, 0, value.Length);
                        
                        _length += value.Length;
 
@@ -583,7 +583,7 @@ namespace System.Text {
                        InternalEnsureCapacity (_length + 1);
                        
                        // Move everything to the right of the insert point across
-                       String.InternalStrcpy (_str, index + 1, _str, index, _length - index);
+                       String.CharCopyReverse (_str, index + 1, _str, index, _length - index);
                        
                        _str.InternalSetChar (index, value);
                        _length++;
@@ -698,7 +698,7 @@ namespace System.Text {
 
                                string tmp = String.InternalAllocateStr (capacity);
                                if (_length > 0)
-                                       String.InternalStrcpy (tmp, 0, _str, 0, _length);
+                                       String.CharCopy (tmp, 0, _str, 0, _length);
 
                                _str = tmp;
                        }