From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CF3B4138334 for ; Thu, 2 Jan 2020 14:07:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 036DFE0A81; Thu, 2 Jan 2020 14:07:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D5295E0A6B for ; Thu, 2 Jan 2020 14:07:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 03C0834DE62 for ; Thu, 2 Jan 2020 14:07:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 97841AD for ; Thu, 2 Jan 2020 14:07:04 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1577973995.c7d98c2f2c2d98f8296139b19fd3920bc9e5c3fb.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: quse.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: c7d98c2f2c2d98f8296139b19fd3920bc9e5c3fb X-VCS-Branch: master Date: Thu, 2 Jan 2020 14:07:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2ef0d99c-5304-4a59-a9b2-250992ae0bd5 X-Archives-Hash: 62343c331fd615a50c834fec27f7f0a9 commit: c7d98c2f2c2d98f8296139b19fd3920bc9e5c3fb Author: Fabian Groffen gentoo org> AuthorDate: Thu Jan 2 14:06:35 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Jan 2 14:06:35 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7d98c2f quse: push search atom down to tree_foreach_pkg when applicable Signed-off-by: Fabian Groffen gentoo.org> quse.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/quse.c b/quse.c index a8585be..358d9e0 100644 --- a/quse.c +++ b/quse.c @@ -426,16 +426,9 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv) int portdirfd = -1; /* pacify compiler */ if (state->match || state->do_describe) { - atom = tree_get_atom(pkg_ctx, 0); + atom = tree_get_atom(pkg_ctx, false); if (atom == NULL) return 0; - - if (state->match) { - match = atom_compare(atom, state->match) == EQUAL; - - if (!match) - return 0; - } } if (!state->do_licence) { @@ -719,14 +712,15 @@ int quse_main(int argc, char **argv) } else if (state.do_installed) { tree_ctx *t = tree_open_vdb(portroot, portvdb); state.overlay = NULL; - tree_foreach_pkg_sorted(t, quse_results_cb, &state, NULL); + tree_foreach_pkg_sorted(t, quse_results_cb, &state, state.match); tree_close(t); } else { array_for_each(overlays, n, overlay) { tree_ctx *t = tree_open(portroot, overlay); state.overlay = overlay; if (t != NULL) { - tree_foreach_pkg_sorted(t, quse_results_cb, &state, NULL); + tree_foreach_pkg_sorted(t, quse_results_cb, + &state, state.match); tree_close(t); } }