No subject


Wed Sep 1 02:40:34 PDT 2004


The following provides a slight, but easy performance gain in
Verifier.checkXMLName().

Existing code:
...
for (int i=0, len = name.length(); i<len; i++) {
...


Replace with:
for (int i=1, len = name.length(); i<len; i++) {

Reason:
The first character is already confirmed to be an "isXMLNameStartCharacter",
which is a pure subset of the "isXMLNameCharacter" every other letter is
checked against. Thus, the first letter of every Element and Attribute name
is verified twice.

-jh-

===================================================================
File: no file Verifier.java		Status: Needs Checkout

   Working revision:	1.44	Mon Apr 14 19:24:40 2003
   Repository revision:	1.44	/home/cvs/jdom/src/java/org/jdom/Verifier.java,v

   Existing Tags:
	jdom_1_0_b9_rc1          	(revision: 1.43)
	jdom_1_0_b8              	(revision: 1.32)
	jdom_1_0_b8_rc1          	(revision: 1.32)
	jdom_prefilter           	(revision: 1.23)
	jdom_1_0_b7              	(revision: 1.23)
	jdom_1_0_b6              	(revision: 1.19)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)




More information about the jdom-commits mailing list