Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=ad4eed162798d938fd7be93d73f357f66c1aaf29
commit ad4eed162798d938fd7be93d73f357f66c1aaf29 Author: Michel Hermier <[email protected]> Date: Sun Jul 31 22:32:11 2011 +0200 sync.c: Simplify search code in find_pkginsync. diff --git a/lib/libpacman/sync.c b/lib/libpacman/sync.c index 588d5a6..0757651 100644 --- a/lib/libpacman/sync.c +++ b/lib/libpacman/sync.c @@ -92,20 +92,16 @@ void _pacman_sync_free(void *data) static pmsyncpkg_t *find_pkginsync(char *needle, pmlist_t *haystack) { pmlist_t *i; - pmsyncpkg_t *ps = NULL; - int found = 0; + pmsyncpkg_t *ps; - for(i = haystack; i && !found; i = i->next) { + for(i = haystack; i != NULL ; i = i->next) { ps = i->data; if(ps && !strcmp(ps->pkg->name, needle)) { - found = 1; + return(ps); } } - if(!found) { - ps = NULL; - } - return(ps); + return(NULL); } static int istoonew(pmpkg_t *pkg) _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
