diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2016-12-09 09:20:10 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2016-12-09 09:20:10 +0200 |
commit | fdb520cfec0bd90ea0ce6d3b4e1ad35b55aaebd7 (patch) | |
tree | 81450023db14da4269a743faf2bafe3a05871ecb | |
parent | e81aba9c686de0f4c5e8e867f6198a2f6f305d47 (diff) | |
download | rpm-fdb520cfec0bd90ea0ce6d3b4e1ad35b55aaebd7.tar.gz |
Eliminate a mindless switch-case in rpmInstallLoadMacros()
The switch-case is a leftover from times where different formats
sort of needed special handling in here, but RPM_NULL_TYPE is just
hysterical, headerGet() will never return such a data type. So
the whole thing is just moot.
Thanks to Thierry Vignaud for pointing this out.
-rw-r--r-- | lib/relocation.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/relocation.c b/lib/relocation.c index 2a0c73118..3ba4cfeab 100644 --- a/lib/relocation.c +++ b/lib/relocation.c @@ -379,18 +379,12 @@ static void rpmInstallLoadMacros(Header h, int define) * Undefine doesn't need the actual data for anything, but * this way ensures we only undefine what was defined earlier. */ - switch (rpmtdType(&td)) { - default: - if (define) { - body = rpmtdFormat(&td, RPMTD_FORMAT_STRING, NULL); - rpmPushMacro(NULL, tagm->macroname, NULL, body, -1); - free(body); - } else { - rpmPopMacro(NULL, tagm->macroname); - } - break; - case RPM_NULL_TYPE: - break; + if (define) { + body = rpmtdFormat(&td, RPMTD_FORMAT_STRING, NULL); + rpmPushMacro(NULL, tagm->macroname, NULL, body, -1); + free(body); + } else { + rpmPopMacro(NULL, tagm->macroname); } rpmtdFreeData(&td); } |