core/bus_center/lnn/net_ledger/common/src/lnn_map.c
/**
 * delete map, free the map memory
 *
 * @param : map Map see details in type Map
 */
delete map, free the map memory
@param : map Map see details in type Map
delete map free the map memory @param : map Map see details in type Map
void LnnMapDelete(Map *map)
{
    uint32_t i;
    MapNode *node = NULL;
    MapNode *next = NULL;
    if (map == NULL || map->nodes == NULL) {
        return;
    }
    for (i = 0; i < map->bucketSize; i++) {
        node = map->nodes[i];
        while (node != NULL) {
            next = node->next;
            SoftBusFree(node);
            node = next;
        }
    }
    SoftBusFree(map->nodes);
    map->nodes = NULL;
    map->nodeSize = 0;
    map->bucketSize = 0;
}
void LnnMapDelete ( Map * map ) { uint32_t i ; MapNode * node = NULL ; MapNode * next = NULL ; if ( map == NULL || map -> nodes == NULL ) { return ; } for ( i = 0 ; i < map -> bucketSize ; i ++ ) { node = map -> nodes [ i ] ; while ( node != NULL ) { next = node -> next ; SoftBusFree ( node ) ; node = next ; } } SoftBusFree ( map -> nodes ) ; map -> nodes = NULL ; map -> nodeSize = 0 ; map -> bucketSize = 0 ; }
delete map, free the map memory
 @param : map Map see details in type Map
delete map free the map memory @param : map Map see details in type Map