[vlc-commits] input/var: removed useless branching in input_ControlVarStop
Filip Roséen
git at videolan.org
Mon Jul 18 06:24:30 CEST 2016
vlc | branch: master | Filip Roséen <filip at videolabs.io> | Sat Jul 16 22:38:28 2016 +0200| [0bfceb2eeb4c62f5e441fddbdc5877465d0f5df6] | committer: Jean-Baptiste Kempf
input/var: removed useless branching in input_ControlVarStop
Given that the for-loop indirectly checks exactly what the sourrounding
if is checking, there is no need for the outer if.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0bfceb2eeb4c62f5e441fddbdc5877465d0f5df6
---
src/input/var.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/input/var.c b/src/input/var.c
index cb54d28..3859999 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -236,15 +236,12 @@ void input_ControlVarStop( input_thread_t *p_input )
if( p_input->p->i_title > 1 )
InputDelCallbacks( p_input, p_input_title_navigation_callbacks );
- if( p_input->p->i_title > 0 )
+ for( int i = 0; i < p_input->p->i_title; i++ )
{
- for( int i = 0; i < p_input->p->i_title; i++ )
- {
- char name[sizeof("title ") + 3 * sizeof (int)];
+ char name[sizeof("title ") + 3 * sizeof (int)];
- sprintf( name, "title %2u", i );
- var_DelCallback( p_input, name, NavigationCallback, (void *)(intptr_t)i );
- }
+ sprintf( name, "title %2u", i );
+ var_DelCallback( p_input, name, NavigationCallback, (void *)(intptr_t)i );
}
if( !demux_Control( p_demux, DEMUX_GET_TITLE, &i_cur_title ) )
More information about the vlc-commits
mailing list