[libbluray-devel] Remove unneeded if

hpi1 git at videolan.org
Thu Jun 4 14:41:55 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Jun  4 14:35:59 2015 +0300| [edc23fc8e8903cb1330b15dd50b22a464b539ec5] | committer: hpi1

Remove unneeded if

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=edc23fc8e8903cb1330b15dd50b22a464b539ec5
---

 src/libbluray/bdnav/clpi_parse.c |   25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index cf86116..1ad632c 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -623,9 +623,7 @@ _clean_program(CLPI_PROG_INFO *p)
     int ii;
 
     for (ii = 0; ii < p->num_prog; ii++) {
-        if (p->progs[ii].streams != NULL) {
-            X_FREE(p->progs[ii].streams);
-        }
+        X_FREE(p->progs[ii].streams);
     }
     X_FREE(p->progs);
 }
@@ -636,12 +634,8 @@ _clean_cpi(CLPI_CPI *cpi)
     int ii;
 
     for (ii = 0; ii < cpi->num_stream_pid; ii++) {
-        if (cpi->entry[ii].coarse != NULL) {
-            X_FREE(cpi->entry[ii].coarse);
-        }
-        if (cpi->entry[ii].fine != NULL) {
-            X_FREE(cpi->entry[ii].fine);
-        }
+        X_FREE(cpi->entry[ii].coarse);
+        X_FREE(cpi->entry[ii].fine);
     }
     X_FREE(cpi->entry);
 }
@@ -654,17 +648,12 @@ clpi_free(CLPI_CL *cl)
     if (cl == NULL) {
         return;
     }
-    if (cl->clip.atc_delta != NULL) {
-        X_FREE(cl->clip.atc_delta);
-    }
+    X_FREE(cl->clip.atc_delta);
+
     for (ii = 0; ii < cl->sequence.num_atc_seq; ii++) {
-        if (cl->sequence.atc_seq[ii].stc_seq != NULL) {
-            X_FREE(cl->sequence.atc_seq[ii].stc_seq);
-        }
-    }
-    if (cl->sequence.atc_seq != NULL) {
-        X_FREE(cl->sequence.atc_seq);
+        X_FREE(cl->sequence.atc_seq[ii].stc_seq);
     }
+    X_FREE(cl->sequence.atc_seq);
 
     _clean_program(&cl->program);
     _clean_cpi(&cl->cpi);



More information about the libbluray-devel mailing list