Author: joshua
Date: 2006-01-17 16:38:03 -0500 (Tue, 17 Jan 2006)
New Revision: 55698
Modified:
trunk/mcs/class/corlib/System.IO/ChangeLog
trunk/mcs/class/corlib/System.IO/StreamReader.cs
Log:
StreamReader.cs: Avoid two totally unnecessary string creations. (totally
pedantic)
Modified: trunk/mcs/class/corlib/System.IO/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.IO/ChangeLog 2006-01-17 21:33:53 UTC (rev
55697)
+++ trunk/mcs/class/corlib/System.IO/ChangeLog 2006-01-17 21:38:03 UTC (rev
55698)
@@ -1,3 +1,8 @@
+2006-01-17 Joshua Tauberer <[EMAIL PROTECTED]>
+
+ * StreamReader.cs: Avoid two totally unnecessary string creations.
+ (kind of pedantic)
+
2006-01-13 Ben Maurer <[EMAIL PROTECTED]>
* TextWriter.cs: Call char[],int,int from the Write(char[]) method
Modified: trunk/mcs/class/corlib/System.IO/StreamReader.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/StreamReader.cs 2006-01-17 21:33:53 UTC
(rev 55697)
+++ trunk/mcs/class/corlib/System.IO/StreamReader.cs 2006-01-17 21:38:03 UTC
(rev 55698)
@@ -420,7 +420,7 @@
if (foundCR) // don't include the trailing CR
if present
decoded_count--;
- line_builder.Append (new string
(decoded_buffer, begin, decoded_count - begin));
+ line_builder.Append (decoded_buffer, begin,
decoded_count - begin);
if (ReadBuffer () == 0) {
if (line_builder.Capacity > 32768) {
StringBuilder sb = line_builder;
@@ -433,7 +433,7 @@
begin = pos;
end = FindNextEOL ();
if (end < decoded_count && end >= begin) {
- line_builder.Append (new string
(decoded_buffer, begin, end - begin));
+ line_builder.Append (decoded_buffer,
begin, end - begin);
if (line_builder.Capacity > 32768) {
StringBuilder sb = line_builder;
line_builder = null;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches