aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-01 14:50:08 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-01 14:50:08 +0000
commitef18966f6a51d0336e0a75b13354516be5a17d5b (patch)
tree523b386c216979ea0229f9130eda3c1c4b90615d
parent3d9487c1f6c1c9a27dfdcf647c4813ba29be2788 (diff)
downloadperl-URPM-ef18966f6a51d0336e0a75b13354516be5a17d5b.tar
perl-URPM-ef18966f6a51d0336e0a75b13354516be5a17d5b.tar.gz
perl-URPM-ef18966f6a51d0336e0a75b13354516be5a17d5b.tar.bz2
perl-URPM-ef18966f6a51d0336e0a75b13354516be5a17d5b.tar.xz
perl-URPM-ef18966f6a51d0336e0a75b13354516be5a17d5b.zip
(Trans_traverse) simplify using _run_cb_while_traversing() (1/2)
-rw-r--r--URPM.xs11
1 files changed, 1 insertions, 10 deletions
diff --git a/URPM.xs b/URPM.xs
index ce8c8c2..3b2e6ee 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2598,16 +2598,7 @@ Trans_traverse(trans, callback)
mi = rpmtsInitIterator(trans->ts, RPMDBI_PACKAGES, NULL, 0);
while ((h = rpmdbNextIterator(mi))) {
if (SvROK(callback)) {
- dSP;
- URPM__Package pkg = calloc(1, sizeof(struct s_Package));
- pkg->flag = FLAG_ID_INVALID | FLAG_NO_HEADER_FREE;
- pkg->h = h;
- PUSHMARK(SP);
- mXPUSHs(sv_setref_pv(newSVpvs(""), "URPM::Package", pkg));
- PUTBACK;
- call_sv(callback, G_DISCARD | G_SCALAR);
- SPAGAIN;
- pkg->h = NULL; /* avoid using it anymore, in case it has been copied inside callback */
+ _run_cb_while_traversing(callback, h, G_DISCARD);
}
++c;
}