diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-11-01 14:50:08 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-11-01 14:50:08 +0000 |
commit | ef18966f6a51d0336e0a75b13354516be5a17d5b (patch) | |
tree | 523b386c216979ea0229f9130eda3c1c4b90615d /URPM.xs | |
parent | 3d9487c1f6c1c9a27dfdcf647c4813ba29be2788 (diff) | |
download | perl-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)
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -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; } |