From e825e071bb9c7de171650ba1bce4823264904956 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 9 Dec 2016 09:24:18 +0200 Subject: [PATCH] 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. --- lib/header.c | 14 +++----------- 1 file 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;