summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2023-03-22 11:11:37 +0200
committerPanu Matilainen <pmatilai@redhat.com>2023-03-22 11:17:45 +0200
commit528a43abc42c04e132faf8c954ed654cba40a78e (patch)
tree75f492d8bc2f728e07b12101d0823ef3c181fc1b
parent4a2f13bf6b9a48e7c16d8effd4d9a1f679d3642f (diff)
downloadrpm-528a43abc42c04e132faf8c954ed654cba40a78e.tar.gz
Eliminate code duplication from rpmdsNext()
Now that we can, let rpmdsSetIx() take care of the details.
-rw-r--r--lib/rpmds.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 3290d2282..ea1a74c5d 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -691,12 +691,8 @@ int rpmdsNext(rpmds ds)
{
int i = -1;
- if (ds != NULL && ++ds->i >= 0) {
- if (ds->i < ds->Count) {
- i = ds->i;
- ds->DNEVR = _free(ds->DNEVR);
- } else
- ds->i = -1;
+ if (ds != NULL)
+ i = rpmdsSetIx(ds, ds->i + 1);
return i;
}