dcavalca / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
Florian Festi 0408f9
From 0bc13d75b5883ccf4d6579f7a60fb1badd104649 Mon Sep 17 00:00:00 2001
Florian Festi 0408f9
From: Panu Matilainen <pmatilai@redhat.com>
Florian Festi 0408f9
Date: Thu, 10 Feb 2022 10:23:22 +0200
Florian Festi 0408f9
Subject: [PATCH] Eliminate code duplication from rpmfiNext()
Florian Festi 0408f9
Florian Festi 0408f9
Now that we can, let rpmfiSetFX() take care of the details.
Florian Festi 0408f9
---
Florian Festi 0408f9
 lib/rpmfi.c | 11 ++---------
Florian Festi 0408f9
 1 file changed, 2 insertions(+), 9 deletions(-)
Florian Festi 0408f9
Florian Festi 0408f9
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
Florian Festi 0408f9
index 689ead2c5..aec8220a3 100644
Florian Festi 0408f9
--- a/lib/rpmfi.c
Florian Festi 0408f9
+++ b/lib/rpmfi.c
Florian Festi 0408f9
@@ -856,15 +856,8 @@ int rpmfiNext(rpmfi fi)
Florian Festi 0408f9
 	    next = fi->next(fi);
Florian Festi 0408f9
 	} while (next == RPMERR_ITER_SKIP);
Florian Festi 0408f9
 
Florian Festi 0408f9
-	if (next >= 0 && next < rpmfilesFC(fi->files)) {
Florian Festi 0408f9
-	    fi->i = next;
Florian Festi 0408f9
-	    fi->j = rpmfilesDI(fi->files, fi->i);
Florian Festi 0408f9
-	} else {
Florian Festi 0408f9
-	    fi->i = -1;
Florian Festi 0408f9
-	    if (next >= 0) {
Florian Festi 0408f9
-		next = -1;
Florian Festi 0408f9
-	    }
Florian Festi 0408f9
-	}
Florian Festi 0408f9
+	if (next >= 0)
Florian Festi 0408f9
+	    next = rpmfiSetFX(fi, next);
Florian Festi 0408f9
     }
Florian Festi 0408f9
     return next;
Florian Festi 0408f9
 }
Florian Festi 0408f9
-- 
Florian Festi 0408f9
2.41.0
Florian Festi 0408f9