Skip to content
Browse files

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.


svn path=/branches/mono-1-0/mcs/; revision=39888
  • Loading branch information...
1 parent fd0db3b commit e1eb581e8a9100a929827524d1d2f91bd5685739 Ben Maurer committed Feb 1, 2005
Showing with 9 additions and 3 deletions.
  1. +5 −0 mcs/class/corlib/System.Text/ChangeLog
  2. +4 −3 mcs/class/corlib/System.Text/StringBuilder.cs
View
5 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
View
7 mcs/class/corlib/System.Text/StringBuilder.cs
@@ -229,15 +229,16 @@ public StringBuilder Remove (int startIndex, int length)
// 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;
}

0 comments on commit e1eb581

Please sign in to comment.
Something went wrong with that request. Please try again.