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 2008/10/14 15:59:07 UTC
svn commit: r704543 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
Author: mrglavas
Date: Tue Oct 14 06:59:06 2008
New Revision: 704543
URL: http://svn.apache.org/viewvc?rev=704543&view=rev
Log:
Minor performance improvement. Iterate over the entries in the map instead
of the keys. This avoids a redundant table lookup for each value.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java?rev=704543&r1=704542&r2=704543&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/CoreDocumentImpl.java Tue Oct 14 06:59:06 2008
@@ -2450,14 +2450,15 @@
* @param operation The operation - import, clone, or delete.
* @param handlers Data associated with n.
*/
- void callUserDataHandlers(Node n, Node c, short operation,Hashtable userData) {
+ void callUserDataHandlers(Node n, Node c, short operation, Hashtable userData) {
if (userData == null || userData.isEmpty()) {
return;
}
- Enumeration keys = userData.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- UserDataRecord r = (UserDataRecord) userData.get(key);
+ Iterator entries = userData.entrySet().iterator();
+ while (entries.hasNext()) {
+ Map.Entry entry = (Map.Entry) entries.next();
+ String key = (String) entry.getKey();
+ UserDataRecord r = (UserDataRecord) entry.getValue();
if (r.fHandler != null) {
r.fHandler.handle(operation, key, r.fData, n, c);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org