1 |
commit: d136dcae0c0b4a177e42ad42e1396e43a82c0a12 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 6 18:03:27 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 6 18:03:27 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d136dcae |
7 |
|
8 |
qdepends: make atom calls cheaper for the majority of calls |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
qdepends.c | 11 ++++++++--- |
13 |
1 file changed, 8 insertions(+), 3 deletions(-) |
14 |
|
15 |
diff --git a/qdepends.c b/qdepends.c |
16 |
index e49e533..64bf991 100644 |
17 |
--- a/qdepends.c |
18 |
+++ b/qdepends.c |
19 |
@@ -116,7 +116,7 @@ qdepends_results_cb(vdb_pkg_ctx *pkg_ctx, void *priv) |
20 |
* *DEPEND alters the search somewhat and affects results printing. |
21 |
*/ |
22 |
|
23 |
- datom = vdb_get_atom(pkg_ctx); |
24 |
+ datom = vdb_get_atom(pkg_ctx, false); |
25 |
if (datom == NULL) |
26 |
return ret; |
27 |
|
28 |
@@ -135,6 +135,7 @@ qdepends_results_cb(vdb_pkg_ctx *pkg_ctx, void *priv) |
29 |
|
30 |
ret = 1; |
31 |
|
32 |
+ datom = vdb_get_atom(pkg_ctx, true); |
33 |
printf("%s:", atom_format(state->format, datom, 0)); |
34 |
} |
35 |
|
36 |
@@ -172,8 +173,10 @@ qdepends_results_cb(vdb_pkg_ctx *pkg_ctx, void *priv) |
37 |
if (atom == NULL) { |
38 |
ret = 1; |
39 |
|
40 |
- if (!firstmatch) |
41 |
+ if (!firstmatch) { |
42 |
+ datom = vdb_get_atom(pkg_ctx, true); |
43 |
printf("%s:", atom_format(state->format, datom, 0)); |
44 |
+ } |
45 |
firstmatch = true; |
46 |
|
47 |
printf("\n%s=\"\n", *dfile); |
48 |
@@ -199,8 +202,10 @@ qdepends_results_cb(vdb_pkg_ctx *pkg_ctx, void *priv) |
49 |
if (fatom == NULL) { |
50 |
ret = 1; |
51 |
|
52 |
- if (!firstmatch) |
53 |
+ if (!firstmatch) { |
54 |
+ datom = vdb_get_atom(pkg_ctx, true); |
55 |
printf("%s:", atom_format(state->format, datom, 0)); |
56 |
+ } |
57 |
firstmatch = true; |
58 |
|
59 |
snprintf(buf, sizeof(buf), "%s%s%s", |