Skip to content

Commit ac371be

Browse files
committed
Remove hasStep variant (not enough wins to justify the code size increase)
1 parent ce6b69f commit ac371be

File tree

1 file changed

+14
-30
lines changed

1 file changed

+14
-30
lines changed

lib/compress/zstd_fast.c

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
587587
U32* const hashTable = ms->hashTable;
588588
U32 const hlog = cParams->hashLog;
589589
/* support stepSize of 0 */
590-
size_t const stepSize = hasStep ? (cParams->targetLength + !(cParams->targetLength) + 1) : 2;
590+
size_t const stepSize = cParams->targetLength + !(cParams->targetLength) + 1;
591591
const BYTE* const base = ms->window.base;
592592
const BYTE* const dictBase = ms->window.dictBase;
593593
const BYTE* const istart = (const BYTE*)src;
@@ -625,6 +625,8 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
625625
const BYTE* nextStep;
626626
const size_t kStepIncr = (1 << (kSearchStrength - 1));
627627

628+
(void)hasStep; /* not currently specialized on whether it's accelerated */
629+
628630
DEBUGLOG(5, "ZSTD_compressBlock_fast_extDict_generic (offset_1=%u)", offset_1);
629631

630632
/* switch to "regular" variant if extDict is invalidated due to maxDistance */
@@ -825,11 +827,6 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
825827
goto _start;
826828
}
827829

828-
ZSTD_GEN_FAST_FN(extDict, 4, 1)
829-
ZSTD_GEN_FAST_FN(extDict, 5, 1)
830-
ZSTD_GEN_FAST_FN(extDict, 6, 1)
831-
ZSTD_GEN_FAST_FN(extDict, 7, 1)
832-
833830
ZSTD_GEN_FAST_FN(extDict, 4, 0)
834831
ZSTD_GEN_FAST_FN(extDict, 5, 0)
835832
ZSTD_GEN_FAST_FN(extDict, 6, 0)
@@ -841,29 +838,16 @@ size_t ZSTD_compressBlock_fast_extDict(
841838
{
842839
U32 const mls = ms->cParams.minMatch;
843840
assert(ms->dictMatchState == NULL);
844-
if (ms->cParams.targetLength > 1) {
845-
switch (mls) {
846-
default: /* includes case 3 */
847-
case 4 :
848-
return ZSTD_compressBlock_fast_extDict_4_1(ms, seqStore, rep, src, srcSize);
849-
case 5 :
850-
return ZSTD_compressBlock_fast_extDict_5_1(ms, seqStore, rep, src, srcSize);
851-
case 6 :
852-
return ZSTD_compressBlock_fast_extDict_6_1(ms, seqStore, rep, src, srcSize);
853-
case 7 :
854-
return ZSTD_compressBlock_fast_extDict_7_1(ms, seqStore, rep, src, srcSize);
855-
}
856-
} else {
857-
switch (mls) {
858-
default: /* includes case 3 */
859-
case 4 :
860-
return ZSTD_compressBlock_fast_extDict_4_0(ms, seqStore, rep, src, srcSize);
861-
case 5 :
862-
return ZSTD_compressBlock_fast_extDict_5_0(ms, seqStore, rep, src, srcSize);
863-
case 6 :
864-
return ZSTD_compressBlock_fast_extDict_6_0(ms, seqStore, rep, src, srcSize);
865-
case 7 :
866-
return ZSTD_compressBlock_fast_extDict_7_0(ms, seqStore, rep, src, srcSize);
867-
}
841+
switch(mls)
842+
{
843+
default: /* includes case 3 */
844+
case 4 :
845+
return ZSTD_compressBlock_fast_extDict_4_0(ms, seqStore, rep, src, srcSize);
846+
case 5 :
847+
return ZSTD_compressBlock_fast_extDict_5_0(ms, seqStore, rep, src, srcSize);
848+
case 6 :
849+
return ZSTD_compressBlock_fast_extDict_6_0(ms, seqStore, rep, src, srcSize);
850+
case 7 :
851+
return ZSTD_compressBlock_fast_extDict_7_0(ms, seqStore, rep, src, srcSize);
868852
}
869853
}

0 commit comments

Comments
 (0)