[vlc-devel] [PATCH 04/10] input/meta: post-pone variable-declaration in vlc_meta_Merge

Filip Roséen filip at atch.se
Mon Oct 10 18:17:56 CEST 2016


ppsz_all_keys is not used until later in the function, as such the
declaration has been move to the point of initialization (ie. where we
actually need it).
---
 src/input/meta.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/input/meta.c b/src/input/meta.c
index 2102eed..3255c49 100644
--- a/src/input/meta.c
+++ b/src/input/meta.c
@@ -176,8 +176,6 @@ void vlc_meta_SetStatus( vlc_meta_t *m, int status )
  */
 void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
 {
-    char **ppsz_all_keys;
-
     if( !dst || !src )
         return;
 
@@ -191,7 +189,7 @@ void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
     }
 
     /* XXX: If speed up are needed, it is possible */
-    ppsz_all_keys = vlc_dictionary_all_keys( &src->extra_tags );
+    char **ppsz_all_keys = vlc_dictionary_all_keys( &src->extra_tags );
     for( int i = 0; ppsz_all_keys && ppsz_all_keys[i]; i++ )
     {
         /* Always try to remove the previous value */
-- 
2.10.0



More information about the vlc-devel mailing list