mrglavas 2004/01/19 14:12:10
Modified: java/src/org/apache/xerces/util XMLAttributesImpl.java
Log:
Improve performance of getType. To determine if we're looking
at an enumerated type it is sufficient to check that the first char
is a '('. If it is a '(' then it cannot be anything else.
Revision Changes Path
1.24 +3 -3
xml-xerces/java/src/org/apache/xerces/util/XMLAttributesImpl.java
Index: XMLAttributesImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/util/XMLAttributesImpl.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- XMLAttributesImpl.java 4 Nov 2003 04:48:49 -0000 1.23
+++ XMLAttributesImpl.java 19 Jan 2004 22:12:10 -0000 1.24
@@ -976,9 +976,9 @@
* @param type attribute type
* @return the value passed in or NMTOKEN if it's an enumerated type.
*/
- protected String getReportableType(String type) {
+ private String getReportableType(String type) {
- if (type.indexOf('(') == 0 && type.lastIndexOf(')') == type.length()-1) {
+ if (type.charAt(0) == '(') {
return "NMTOKEN";
}
return type;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]