diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2023-03-22 11:11:37 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2023-03-22 11:17:45 +0200 |
commit | 528a43abc42c04e132faf8c954ed654cba40a78e (patch) | |
tree | 75f492d8bc2f728e07b12101d0823ef3c181fc1b | |
parent | 4a2f13bf6b9a48e7c16d8effd4d9a1f679d3642f (diff) | |
download | rpm-528a43abc42c04e132faf8c954ed654cba40a78e.tar.gz |
Eliminate code duplication from rpmdsNext()
Now that we can, let rpmdsSetIx() take care of the details.
-rw-r--r-- | lib/rpmds.c | 8 |
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; } |