From: RĂ©mi Duraffort Date: Fri, 24 Jul 2009 07:05:58 +0000 (+0200) Subject: No need to check for the existence of the variable to destroy it. X-Git-Tag: 1.1.0-ff~4834 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5f65c5c91055c4a3e861dfbfa8d70547c466d12a;p=vlc No need to check for the existence of the variable to destroy it. Destroying directly saves one Lookup. --- diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c index b31b02f4af..a0bbe372ee 100644 --- a/src/audio_output/dec.c +++ b/src/audio_output/dec.c @@ -231,14 +231,8 @@ int aout_DecDelete( aout_instance_t * p_aout, aout_input_t * p_input ) { aout_OutputDelete( p_aout ); aout_MixerDelete( p_aout ); - if ( var_Type( p_aout, "audio-device" ) != 0 ) - { - var_Destroy( p_aout, "audio-device" ); - } - if ( var_Type( p_aout, "audio-channels" ) != 0 ) - { - var_Destroy( p_aout, "audio-channels" ); - } + var_Destroy( p_aout, "audio-device" ); + var_Destroy( p_aout, "audio-channels" ); } aout_unlock_mixer( p_aout ); diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c index e20ecfdbac..db9d64a219 100644 --- a/src/audio_output/intf.c +++ b/src/audio_output/intf.c @@ -440,14 +440,8 @@ int aout_FindAndRestart( vlc_object_t * p_this, const char *psz_name, (void)psz_name; (void)oldval; (void)newval; (void)p_data; if ( p_aout == NULL ) return VLC_SUCCESS; - if ( var_Type( p_aout, "audio-device" ) != 0 ) - { - var_Destroy( p_aout, "audio-device" ); - } - if ( var_Type( p_aout, "audio-channels" ) != 0 ) - { - var_Destroy( p_aout, "audio-channels" ); - } + var_Destroy( p_aout, "audio-device" ); + var_Destroy( p_aout, "audio-channels" ); aout_Restart( p_aout ); vlc_object_release( p_aout ); @@ -469,10 +463,7 @@ int aout_ChannelsRestart( vlc_object_t * p_this, const char * psz_variable, { /* This is supposed to be a significant change and supposes * rebuilding the channel choices. */ - if ( var_Type( p_aout, "audio-channels" ) >= 0 ) - { - var_Destroy( p_aout, "audio-channels" ); - } + var_Destroy( p_aout, "audio-channels" ); } aout_Restart( p_aout ); return 0;