Simplify intGetTdEntry()

Ultimately there are exactly two possibilities here and we certainly
don't need a switch-case to handle it.

Thanks to Thierry Vignaud for pointing this out.
This commit is contained in:
Panu Matilainen 2016-12-09 09:24:18 +02:00
parent fdb520cfec
commit e825e071bb
1 changed files with 3 additions and 11 deletions

View File

@ -1288,18 +1288,10 @@ static int intGetTdEntry(Header h, rpmtd td, headerGetFlags flags)
return 0;
}
if (flags & HEADERGET_RAW) {
if (entry->info.type == RPM_I18NSTRING_TYPE && !(flags & HEADERGET_RAW))
rc = copyI18NEntry(h, entry, td, flags);
else
rc = copyTdEntry(entry, td, flags);
} else {
switch (entry->info.type) {
case RPM_I18NSTRING_TYPE:
rc = copyI18NEntry(h, entry, td, flags);
break;
default:
rc = copyTdEntry(entry, td, flags);
break;
}
}
if (rc == 0)
td->flags |= RPMTD_INVALID;