[vlc-devel] [PATCH] lua/vlc: vlc_sd_probe_Open: use vlc_dictionary_has_key

Filip Roséen filip at atch.se
Thu May 18 12:19:31 CEST 2017


As we are only checking whether the dictionary has a certain key (to
prevent loading the same thing twice), vlc_dictionary_has_key is
semantically more correct than vlc_dictionary_value_for_key.
---
 modules/lua/vlc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index be7dbfd7e2..86d7332c1e 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -548,8 +548,7 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
             if( temp )
                 *temp = '\0';
 
-            if( vlc_dictionary_value_for_key( &name_d, *ppsz_file ) ==
-                    kVLCDictionaryNotFound )
+            if( !vlc_dictionary_has_key( &name_d, *ppsz_file ) )
                 vlc_dictionary_insert( &name_d, *ppsz_file, &name_d );
             free( *ppsz_file );
         }
-- 
2.12.2


More information about the vlc-devel mailing list