[vlc-commits] modules: remove unnecessary checks

Rémi Denis-Courmont git at videolan.org
Tue Aug 14 23:59:41 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 15 00:57:05 2012 +0300| [2f3f089919e74ebcae389ef917e6c1d300c71c1e] | committer: Rémi Denis-Courmont

modules: remove unnecessary checks

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

 src/modules/entry.c |   17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/modules/entry.c b/src/modules/entry.c
index 6221f96..2865a3d 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -409,19 +409,14 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...)
 
             /* Copy textual descriptions */
             const char *const *text = va_arg (ap, const char *const *);
-            if (text != NULL)
+            char **dtext = malloc (sizeof (char *) * (len + 1));
+            if( dtext != NULL )
             {
-                char **dtext = malloc (sizeof (char *) * (len + 1));
-                if( dtext != NULL )
-                {
-                    for (size_t i = 0; i < len; i++)
-                        dtext[i] = text[i] ? strdup (text[i]) : NULL;
-                    dtext[len] = NULL;
-                }
-                item->ppsz_list_text = dtext;
+                for (size_t i = 0; i < len; i++)
+                    dtext[i] = text[i] ? strdup (text[i]) : NULL;
+                dtext[len] = NULL;
             }
-            else
-                item->ppsz_list_text = NULL;
+            item->ppsz_list_text = dtext;
 
             item->i_list = len;
             item->pf_update_list = va_arg (ap, vlc_callback_t);



More information about the vlc-commits mailing list