liblzma: Refactor lzma_mf_is_supported() to use a switch-statement.
This commit is contained in:
parent
4d80b463a1
commit
61f8ec804a
|
@ -601,32 +601,28 @@ lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||||
extern LZMA_API(lzma_bool)
|
extern LZMA_API(lzma_bool)
|
||||||
lzma_mf_is_supported(lzma_match_finder mf)
|
lzma_mf_is_supported(lzma_match_finder mf)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
switch (mf) {
|
||||||
|
|
||||||
#ifdef HAVE_MF_HC3
|
#ifdef HAVE_MF_HC3
|
||||||
if (mf == LZMA_MF_HC3)
|
case LZMA_MF_HC3:
|
||||||
ret = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MF_HC4
|
#ifdef HAVE_MF_HC4
|
||||||
if (mf == LZMA_MF_HC4)
|
case LZMA_MF_HC4:
|
||||||
ret = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MF_BT2
|
#ifdef HAVE_MF_BT2
|
||||||
if (mf == LZMA_MF_BT2)
|
case LZMA_MF_BT2:
|
||||||
ret = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MF_BT3
|
#ifdef HAVE_MF_BT3
|
||||||
if (mf == LZMA_MF_BT3)
|
case LZMA_MF_BT3:
|
||||||
ret = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MF_BT4
|
#ifdef HAVE_MF_BT4
|
||||||
if (mf == LZMA_MF_BT4)
|
case LZMA_MF_BT4:
|
||||||
ret = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
return ret;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue