Index: trunk/psLib/src/collections/psMetadata.c
===================================================================
--- trunk/psLib/src/collections/psMetadata.c	(revision 2659)
+++ trunk/psLib/src/collections/psMetadata.c	(revision 2681)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-12-07 23:27:25 $
+*  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-12-10 02:50:14 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -352,8 +352,6 @@
 {
     psList* mdList = NULL;
-    psList* entryList = NULL;
     psHash* mdTable = NULL;
     psMetadataItem* entry = NULL;
-    psMetadataItem* entryChild = NULL;
 
 
@@ -375,29 +373,4 @@
         }
 
-        if (entry->type == PS_META_LIST) {
-
-            // Table entry has children. Entry and children must be removed from metadata collection's list
-            psListSetIterator(entryList, PS_LIST_HEAD);
-            entryChild = psListGetCurrent(entryList);
-            while(entryChild != NULL) {
-                if (!psListRemove(mdList, PS_LIST_UNKNOWN, entryChild)) {
-                    psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
-                    return false;
-                }
-                entryChild = psListGetNext(entryList);
-            }
-        } else {
-
-            // Table entry has no children. Remove entry from metadata collection's list
-            if (!psListRemove(mdList, PS_LIST_UNKNOWN, entry)) {
-                psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
-                return false;
-            }
-        }
-        // Remove entry from metadata collection's table
-        if (!psHashRemove(mdTable, key)) {
-            psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
-            return false;
-        }
     } else {
 
@@ -414,6 +387,15 @@
             return false;
         }
-        // Use recursive remove, now that key is known
-        psMetadataRemove(md, PS_LIST_UNKNOWN, key);
+    }
+
+    if (!psListRemoveData(mdList, entry)) {
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
+        return false;
+    }
+
+    // Remove entry from metadata collection's table
+    if (!psHashRemove(mdTable, key)) {
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
+        return false;
     }
 
