IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 11, 2004, 2:40:42 PM (22 years ago)
Author:
harman
Message:

Modified deleteItem function to delete multiple items of same name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psMetadata.c

    r1458 r1493  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-10 23:32:51 $
     14*  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-12 00:40:42 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    413413
    414414            // Table entry has children. Entry and children must be removed from metadata collection's list
    415             psListSetIterator(mdList, PS_LIST_HEAD);
    416             entryChild = psListGetCurrent(mdList);
     415            psListSetIterator(entry->items, PS_LIST_HEAD);
     416            entryChild = psListGetCurrent(entry->items);
    417417            while (entryChild != NULL) {
    418                 if (!psListRemove(entry->items, entryChild, PS_LIST_UNKNOWN)) {
     418                if (!psListRemove(mdList, entryChild, PS_LIST_UNKNOWN)) {
    419419                    psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
    420420                    return false;
     
    422422                entryChild = psListGetNext(entry->items);
    423423            }
    424         }
    425         // Remove entry from metadata collection's list
    426         if (!psListRemove(mdList, entry, PS_LIST_UNKNOWN)) {
    427             psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
    428             return false;
     424        } else {
     425
     426            // Table entry has no children. Remove entry from metadata collection's list
     427            if (!psListRemove(mdList, entry, PS_LIST_UNKNOWN)) {
     428                psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
     429                return false;
     430            }
    429431        }
    430432        // Remove entry from metadata collection's table
Note: See TracChangeset for help on using the changeset viewer.