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:58:47 UTC

svn commit: r704542 - /xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java

Author: mrglavas
Date: Tue Oct 14 06:58:47 2008
New Revision: 704542

URL: http://svn.apache.org/viewvc?rev=704542&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/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java

Modified: xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java?rev=704542&r1=704541&r2=704542&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java Tue Oct 14 06:58:47 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