Dont bother with rpmRelocateFileList() if relocations have been specified
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 2 Oct 2012 13:17:05 +0000 (16:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 2 Oct 2012 13:17:05 +0000 (16:17 +0300)
- rpmRelocateFileList() doesn't modify anything when no relocations
  are to be done, but what it does is not exactly free, unnecessarily
  calling it is dumb.

lib/rpmte.c

index a6dced0..35b8e3e 100644 (file)
@@ -94,7 +94,7 @@ static rpmfi getFI(rpmte p, Header h)
                                      (RPMFI_NOHEADER | RPMFI_FLAGS_ERASE);
 
     /* relocate stuff in header if necessary */
-    if (rpmteType(p) == TR_ADDED && rpmfsFC(p->fs) > 0) {
+    if (rpmteType(p) == TR_ADDED && rpmfsFC(p->fs) > 0 && p->nrelocs) {
        if (!headerIsSource(h) && !headerIsEntry(h, RPMTAG_ORIGBASENAMES)) {
            rpmRelocateFileList(p->relocs, p->nrelocs, p->fs, h);
        }