Commit 166873ee authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use TAB_REMOVE instead of REMOVE_ELEM where applicable

parent 8d943b44
......@@ -1564,16 +1564,8 @@ static int RemoveAnnounce( services_discovery_t *p_sd,
p_announce->p_item = NULL;
}
for( i = 0; i< p_sd->p_sys->i_announces; i++)
{
if( p_sd->p_sys->pp_announces[i] == p_announce )
{
REMOVE_ELEM( p_sd->p_sys->pp_announces, p_sd->p_sys->i_announces,
i);
break;
}
}
TAB_REMOVE(p_sd->p_sys->i_announces, p_sd->p_sys->pp_announces,
p_announce);
free( p_announce );
return VLC_SUCCESS;
......
......@@ -1261,14 +1261,8 @@ static void RecursiveNodeDelete( input_item_node_t *p_node )
void input_item_node_Delete( input_item_node_t *p_node )
{
if( p_node->p_parent )
for( int i = 0; i < p_node->p_parent->i_children; i++ )
if( p_node->p_parent->pp_children[i] == p_node )
{
REMOVE_ELEM( p_node->p_parent->pp_children,
p_node->p_parent->i_children,
i );
break;
}
TAB_REMOVE(p_node->p_parent->i_children, p_node->p_parent->pp_children,
p_node);
RecursiveNodeDelete( p_node );
}
......
......@@ -131,16 +131,7 @@ void playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
/* Remove the item from its parent */
playlist_item_t *p_parent = p_root->p_parent;
if( p_parent != NULL )
{
for( int i = 0; i < p_parent->i_children ; i++ )
{
if( p_parent->pp_children[i] == p_root )
{
REMOVE_ELEM( p_parent->pp_children, p_parent->i_children, i );
assert( p_root->p_parent == p_parent );
}
}
}
TAB_REMOVE(p_parent->i_children, p_parent->pp_children, p_root);
playlist_ItemRelease( p_playlist, p_root );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment