xbps-query/search: handle vpkg matches into its own conditional; a small performance improvement.

This commit is contained in:
Juan RP 2014-07-06 09:33:59 +02:00
parent 0385812a5a
commit 36ad783f07

View File

@ -125,10 +125,15 @@ search_array_cb(struct xbps_handle *xhp _unused,
xbps_array_add_cstring_nocopy(sd->results, desc); xbps_array_add_cstring_nocopy(sd->results, desc);
} }
regfree(&regex); regfree(&regex);
return 0;
}
if (vpkgfound) {
xbps_array_add_cstring_nocopy(sd->results, pkgver);
xbps_array_add_cstring_nocopy(sd->results, desc);
} else { } else {
if ((xbps_pkgpattern_match(pkgver, sd->pat)) || if ((xbps_pkgpattern_match(pkgver, sd->pat)) ||
(strcasestr(pkgver, sd->pat)) || (strcasestr(pkgver, sd->pat)) ||
(strcasestr(desc, sd->pat)) || vpkgfound) { (strcasestr(desc, sd->pat))) {
xbps_array_add_cstring_nocopy(sd->results, pkgver); xbps_array_add_cstring_nocopy(sd->results, pkgver);
xbps_array_add_cstring_nocopy(sd->results, desc); xbps_array_add_cstring_nocopy(sd->results, desc);
} }