Просмотр исходного кода

2004-09-25 Zoltan Varga <[email protected]>

	* StringBuilder.cs (Append): Use InternalStrcpy to append char arrays.

svn path=/trunk/mcs/; revision=34402
Zoltan Varga 21 лет назад
Родитель
Сommit
2252b400e4

+ 5 - 0
mcs/class/corlib/System.Text/ChangeLog

@@ -1,4 +1,9 @@
+2004-09-25  Zoltan Varga  <[email protected]>
+
+	* StringBuilder.cs (Append): Use InternalStrcpy to append char arrays.
+
 2004-09-09  Tim Coleman <[email protected]>
+
 	* StringBuilder.cs: Added AppendLine methods for Fx 2.0
 
 2004-06-23  Sebastien Pouliot  <[email protected]>

+ 4 - 7
mcs/class/corlib/System.Text/StringBuilder.cs

@@ -301,9 +301,7 @@ namespace System.Text {
 			if (null != _cached_str || _str.Length < needed_cap)
 				InternalEnsureCapacity (needed_cap);
 			
-			for (int i = 0; i != value.Length; i++)
-				_str.InternalSetChar (i + _length, value[i]);		
-
+			String.InternalStrcpy (_str, _length, value);
 			_length += value.Length;
 
 			return this;
@@ -421,10 +419,9 @@ namespace System.Text {
 			
 			
 			InternalEnsureCapacity (_length + charCount);
-			
-			int endPos = charCount + startIndex;
-			for (int i = startIndex; i != endPos; i++)
-				_str.InternalSetChar (_length++, value[i]);
+
+			String.InternalStrcpy (_str, _length, value, startIndex, charCount);
+			_length += charCount;
 
 			return this;
 		}