Clean Up Search Function Selection
This commit is contained in:
@@ -762,12 +762,27 @@ ZSTD_compressBlock_lazy_generic(
|
|||||||
typedef size_t (*searchMax_f)(
|
typedef size_t (*searchMax_f)(
|
||||||
ZSTD_matchState_t* ms,
|
ZSTD_matchState_t* ms,
|
||||||
const BYTE* ip, const BYTE* iLimit, size_t* offsetPtr);
|
const BYTE* ip, const BYTE* iLimit, size_t* offsetPtr);
|
||||||
searchMax_f const searchMax = dictMode == ZSTD_dictMatchState ?
|
|
||||||
(searchMethod==search_binaryTree ? ZSTD_BtFindBestMatch_dictMatchState_selectMLS
|
const searchMax_f searchFuncs[4][2] = {
|
||||||
: ZSTD_HcFindBestMatch_dictMatchState_selectMLS) :
|
{
|
||||||
(dictMode == ZSTD_dedicatedDictSearch ? ZSTD_HcFindBestMatch_dedicatedDictSearch_selectMLS :
|
ZSTD_HcFindBestMatch_selectMLS,
|
||||||
(searchMethod==search_binaryTree ? ZSTD_BtFindBestMatch_selectMLS
|
ZSTD_BtFindBestMatch_selectMLS
|
||||||
: ZSTD_HcFindBestMatch_selectMLS));
|
},
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ZSTD_HcFindBestMatch_dictMatchState_selectMLS,
|
||||||
|
ZSTD_BtFindBestMatch_dictMatchState_selectMLS
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ZSTD_HcFindBestMatch_dedicatedDictSearch_selectMLS,
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
searchMax_f const searchMax = searchFuncs[dictMode][searchMethod == search_binaryTree];
|
||||||
U32 offset_1 = rep[0], offset_2 = rep[1], savedOffset=0;
|
U32 offset_1 = rep[0], offset_2 = rep[1], savedOffset=0;
|
||||||
|
|
||||||
const ZSTD_matchState_t* const dms = ms->dictMatchState;
|
const ZSTD_matchState_t* const dms = ms->dictMatchState;
|
||||||
@@ -784,6 +799,8 @@ ZSTD_compressBlock_lazy_generic(
|
|||||||
0;
|
0;
|
||||||
const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictLowest));
|
const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictLowest));
|
||||||
|
|
||||||
|
assert(searchMax != NULL);
|
||||||
|
|
||||||
DEBUGLOG(5, "ZSTD_compressBlock_lazy_generic (dictMode=%u)", (U32)dictMode);
|
DEBUGLOG(5, "ZSTD_compressBlock_lazy_generic (dictMode=%u)", (U32)dictMode);
|
||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
|
|||||||
Reference in New Issue
Block a user