[vlc-devel] commit: xtag: simplify ( remove a dummy test and makes some static code analyser happy). ( Rémi Duraffort )

git version control git at videolan.org
Fri Oct 16 19:32:04 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 16 19:25:19 2009 +0200| [cf72f53237c0edadf0d1f2d087983d673516e081] | committer: Rémi Duraffort 

xtag: simplify (remove a dummy test and makes some static code analyser happy).

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

 modules/misc/xml/xtag.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/misc/xml/xtag.c b/modules/misc/xml/xtag.c
index 957bd59..668fd80 100644
--- a/modules/misc/xml/xtag.c
+++ b/modules/misc/xml/xtag.c
@@ -361,13 +361,12 @@ static XList *xlist_append( XList *list, void *data )
     if( !list )
         return l;
 
-    for( last = list; last; last = last->next )
-    {
-        if( !last->next )
-            break;
-    }
+    /* Find the last element */
+    last = list;
+    while( last->next )
+        last = last->next;
 
-    if( last ) last->next = l;
+    last->next = l;
     l->prev = last;
     return list;
 }




More information about the vlc-devel mailing list