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 2005/05/25 06:24:40 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSModelImpl.java
mrglavas 2005/05/24 21:24:40
Modified: java/src/org/apache/xerces/impl/xs XSModelImpl.java
Log:
Avoid object creation. When a substitution group contains no members,
use the empty list singleton instead of creating a new one.
Revision Changes Path
1.18 +4 -3 xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelImpl.java
Index: XSModelImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelImpl.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XSModelImpl.java 6 Oct 2004 15:14:55 -0000 1.17
+++ XSModelImpl.java 25 May 2005 04:24:40 -0000 1.18
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 The Apache Software Foundation.
+ * Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -182,7 +182,8 @@
for (int i = 0; i < len; i++) {
head = (XSElementDecl)elements.item(i);
subGroup = sgHandler.getSubstitutionGroup(head);
- fSubGroupMap.put(head, new XSObjectListImpl(subGroup, subGroup.length));
+ fSubGroupMap.put(head, subGroup.length > 0 ?
+ new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org