]> git.sesse.net Git - vlc/commitdiff
xtag: simplify (remove a dummy test and makes some static code analyser happy).
authorRémi Duraffort <ivoire@videolan.org>
Fri, 16 Oct 2009 17:25:19 +0000 (19:25 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 16 Oct 2009 17:32:17 +0000 (19:32 +0200)
modules/misc/xml/xtag.c

index 957bd597a477ab56a3dc85e4ddb98de1b08877eb..668fd80b78b569446eadb360e7a882f29c9bd046 100644 (file)
@@ -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;
 }