From 36ad783f07ff6bdf13d623963817eedf00c17d84 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 6 Jul 2014 09:33:59 +0200 Subject: [PATCH] xbps-query/search: handle vpkg matches into its own conditional; a small performance improvement. --- bin/xbps-query/search.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/xbps-query/search.c b/bin/xbps-query/search.c index ceef468c..aa3a0917 100644 --- a/bin/xbps-query/search.c +++ b/bin/xbps-query/search.c @@ -125,10 +125,15 @@ search_array_cb(struct xbps_handle *xhp _unused, xbps_array_add_cstring_nocopy(sd->results, desc); } regfree(®ex); + return 0; + } + if (vpkgfound) { + xbps_array_add_cstring_nocopy(sd->results, pkgver); + xbps_array_add_cstring_nocopy(sd->results, desc); } else { if ((xbps_pkgpattern_match(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, desc); }