Browse Source

2005-12-08 Atsushi Enomoto <[email protected]>

	* XmlTextReader.cs : avoid Char.IsSurrogate() and do it inside
	  PeekChar(), which improves notable performance.


svn path=/trunk/mcs/; revision=54116
Atsushi Eno 20 years ago
parent
commit
e8fcabe5d2

+ 5 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2005-12-08  Atsushi Enomoto <[email protected]>
+
+	* XmlTextReader.cs : avoid Char.IsSurrogate() and do it inside
+	  PeekChar(), which improves notable performance.
+
 2005-12-08  Atsushi Enomoto <[email protected]>
 
 	* XmlReaderSettings.cs : Schemas will be created only when it is

+ 1 - 1
mcs/class/System.XML/System.Xml/XmlTextReader.cs

@@ -1110,7 +1110,7 @@ namespace System.Xml
 			char c = peekChars [peekCharsIndex];
 			if (c == 0)
 				return -1;
-			if (!char.IsSurrogate (c))
+			if (c < 0xD800 || 0xDFFF < c)
 				return c;
 			if (peekCharsLength == peekCharsIndex + 1) {
 				if (!ReadTextReader (c))