summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2016-12-09 09:24:18 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-12-09 09:24:18 +0200
commite825e071bb9c7de171650ba1bce4823264904956 (patch)
treea46eb5d2cc25f952083e0c5825b4ca6bfc3e28fb
parentfdb520cfec0bd90ea0ce6d3b4e1ad35b55aaebd7 (diff)
downloadrpm-e825e071bb9c7de171650ba1bce4823264904956.tar.gz
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.
-rw-r--r--lib/header.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/header.c b/lib/header.c
index 7e22df693..f4206d4f2 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -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;