Eliminate unused goo from findEntry()

This commit is contained in:
Panu Matilainen 2009-09-09 14:19:20 +03:00
parent fc976d13b8
commit 451bbb43a8
1 changed files with 2 additions and 11 deletions

View 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;
}