teknoraver / rpms / rpm

Forked from rpms/rpm 3 months ago
Clone

Blame 0001-Eliminate-code-duplication-from-rpmfiNext.patch

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