Eliminate unused goo from findEntry()
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 9 Sep 2009 11:19:20 +0000 (14:19 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 9 Sep 2009 11:19:20 +0000 (14:19 +0300)
lib/header.c

index c4cc78e..441a0bc 100644 (file)
@@ -695,7 +695,7 @@ void * headerUnload(Header h)
 static
 indexEntry findEntry(Header h, rpmTag tag, rpmTagType type)
 {
-    indexEntry entry, entry2, last;
+    indexEntry entry;
     struct indexEntry_s key;
 
     if (h == NULL) return NULL;
@@ -703,8 +703,7 @@ indexEntry findEntry(Header h, rpmTag tag, rpmTagType type)
 
     key.info.tag = tag;
 
-    entry2 = entry = 
-       bsearch(&key, h->index, h->indexUsed, sizeof(*h->index), indexCmp);
+    entry = bsearch(&key, h->index, h->indexUsed, sizeof(*h->index), indexCmp);
     if (entry == NULL)
        return NULL;
 
@@ -718,14 +717,6 @@ indexEntry findEntry(Header h, rpmTag tag, rpmTagType type)
     if (entry->info.tag == tag && entry->info.type == type)
        return entry;
 
-    last = h->index + h->indexUsed;
-    /* FIX: entry2 = entry. Code looks bogus as well. */
-    while (entry2->info.tag == tag && entry2->info.type != type &&
-          entry2 < last) entry2++;
-
-    if (entry->info.tag == tag && entry->info.type == type)
-       return entry;
-
     return NULL;
 }