From cf72f53237c0edadf0d1f2d087983d673516e081 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Fri, 16 Oct 2009 19:25:19 +0200 Subject: [PATCH] xtag: simplify (remove a dummy test and makes some static code analyser happy). --- modules/misc/xml/xtag.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/misc/xml/xtag.c b/modules/misc/xml/xtag.c index 957bd597a4..668fd80b78 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; } -- 2.39.2