Default to the common case wrt dir name/index tags, not relocation
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 13:35:10 +0000 (16:35 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 13:35:10 +0000 (16:35 +0300)
- Avoids an unnecessary extra initialization in the common case, and
  also avoids int/enum mismatch from initializing to 0.

lib/tagexts.c

index 48b4037..36c40c4 100644 (file)
@@ -43,16 +43,13 @@ static void rpmfiBuildFNames(Header h, rpmTag tagN,
     uint32_t *dirIndexes;
     rpm_count_t count;
     size_t size;
-    rpmTag dirNameTag = 0;
-    rpmTag dirIndexesTag = 0;
+    rpmTag dirNameTag = RPMTAG_DIRNAMES;
+    rpmTag dirIndexesTag = RPMTAG_DIRINDEXES;
     char * t;
     int i;
     struct rpmtd_s bnames, dnames, dixs;
 
-    if (tagN == RPMTAG_BASENAMES) {
-       dirNameTag = RPMTAG_DIRNAMES;
-       dirIndexesTag = RPMTAG_DIRINDEXES;
-    } else if (tagN == RPMTAG_ORIGBASENAMES) {
+    if (tagN == RPMTAG_ORIGBASENAMES) {
        dirNameTag = RPMTAG_ORIGDIRNAMES;
        dirIndexesTag = RPMTAG_ORIGDIRINDEXES;
     }