Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Maurer <benm@mono-cvs.ximian.com>2005-02-01 04:04:43 +0300
committerBen Maurer <benm@mono-cvs.ximian.com>2005-02-01 04:04:43 +0300
commite1eb581e8a9100a929827524d1d2f91bd5685739 (patch)
tree33580b7e78c7857042a1d495e12d370cba4813fe
parentfd0db3b590d990846391629a0aa25502f001539f (diff)
2005-01-31 Ben Maurer <bmaurer@ximian.com>mono-1.0.6mono-1-0-6
* StringBuilder.cs (Remove): We need to do the check that the string isnt being cached *before* we munge it. svn path=/branches/mono-1-0/mcs/; revision=39888
-rwxr-xr-xmcs/class/corlib/System.Text/ChangeLog5
-rw-r--r--mcs/class/corlib/System.Text/StringBuilder.cs7
2 files changed, 9 insertions, 3 deletions
diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog
index ab7b1da3d02..8ba8eaf2a08 100755
--- a/mcs/class/corlib/System.Text/ChangeLog
+++ b/mcs/class/corlib/System.Text/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-31 Ben Maurer <bmaurer@ximian.com>
+
+ * StringBuilder.cs (Remove): We need to do the check that the
+ string isnt being cached *before* we munge it.
+
2005-01-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* StringBuilder.cs: when creating the StringBuilder from a string, the
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
index 3e7a3580ee5..9fcf317f9e1 100644
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ b/mcs/class/corlib/System.Text/StringBuilder.cs
@@ -229,15 +229,16 @@ namespace System.Text {
// re-ordered to avoid possible integer overflow
if (startIndex < 0 || length < 0 || startIndex > _length - length)
throw new ArgumentOutOfRangeException();
-
+
+ if (null != _cached_str)
+ InternalEnsureCapacity (_length);
+
// 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));
_length -= length;
- if (null != _cached_str)
- InternalEnsureCapacity (_length);
return this;
}