[vlc-commits] vlm: reduce deletion complexity and help analyzers

Rémi Duraffort git at videolan.org
Thu Jan 2 09:27:51 CET 2014


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Dec 31 16:02:27 2013 +0100| [8efb3b639f6a1c8f96b3d1f8dd5de5db53acb97c] | committer: Rémi Duraffort

vlm: reduce deletion complexity and help analyzers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8efb3b639f6a1c8f96b3d1f8dd5de5db53acb97c
---

 src/input/vlmshell.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/input/vlmshell.c b/src/input/vlmshell.c
index 2573f81..33287ac 100644
--- a/src/input/vlmshell.c
+++ b/src/input/vlmshell.c
@@ -990,18 +990,17 @@ static vlm_schedule_sys_t *vlm_ScheduleNew( vlm_t *vlm, const char *psz_name )
 /* for now, simple delete. After, del with options (last arg) */
 void vlm_ScheduleDelete( vlm_t *vlm, vlm_schedule_sys_t *sched )
 {
+    int i;
     if( sched == NULL ) return;
 
     TAB_REMOVE( vlm->i_schedule, vlm->schedule, sched );
 
     if( vlm->i_schedule == 0 ) free( vlm->schedule );
     free( sched->psz_name );
-    while( sched->i_command )
-    {
-        char *psz_cmd = sched->command[0];
-        TAB_REMOVE( sched->i_command, sched->command, psz_cmd );
-        free( psz_cmd );
-    }
+
+    for ( i = 0; i < sched->i_command; i++ )
+        free( sched->command[i] );
+    free( sched->command );
     free( sched );
 }
 



More information about the vlc-commits mailing list