You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/01/22 22:26:18 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/util XMLChar.java
mrglavas 2004/01/22 13:26:18
Modified: java/src/org/apache/xerces/util XMLChar.java
Log:
Performance improvement.
Tighten necessary bounds check for isSpace. Considering
that the highest character in S in is 0x20, if we tightened
the bounds on these methods we could avoid doing a
lookup in the table some of the time (and actually all of the
time for XML 1.0 documents when we're not actually
looking at a space). Note that in XML 1.0 all allowed
characters <= 0x20 are spaces (TAB, LF, CR, SPACE).
Everything else isn't well-formed.
Revision Changes Path
1.13 +2 -2 xml-xerces/java/src/org/apache/xerces/util/XMLChar.java
Index: XMLChar.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/XMLChar.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XMLChar.java 7 Dec 2002 00:24:06 -0000 1.12
+++ XMLChar.java 22 Jan 2004 21:26:18 -0000 1.13
@@ -485,7 +485,7 @@
* @param c The character to check.
*/
public static boolean isSpace(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_SPACE) != 0;
+ return c <= 0x20 && (CHARS[c] & MASK_SPACE) != 0;
} // isSpace(int):boolean
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org