| 480 | } |
| 481 | |
| 482 | FORCE_INLINE_TEMPLATE |
| 483 | void ZSTD_updateTree_internal( |
| 484 | ZSTD_matchState_t* ms, |
| 485 | const BYTE* const ip, const BYTE* const iend, |
| 486 | const U32 mls, const ZSTD_dictMode_e dictMode) |
| 487 | { |
| 488 | const BYTE* const base = ms->window.base; |
| 489 | U32 const target = (U32)(ip - base); |
| 490 | U32 idx = ms->nextToUpdate; |
| 491 | DEBUGLOG(6, "ZSTD_updateTree_internal, from %u to %u (dictMode:%u)", |
| 492 | idx, target, dictMode); |
| 493 | |
| 494 | while(idx < target) { |
| 495 | U32 const forward = ZSTD_insertBt1(ms, base+idx, iend, mls, dictMode == ZSTD_extDict); |
| 496 | assert(idx < (U32)(idx + forward)); |
| 497 | idx += forward; |
| 498 | } |
| 499 | assert((size_t)(ip - base) <= (size_t)(U32)(-1)); |
| 500 | assert((size_t)(iend - base) <= (size_t)(U32)(-1)); |
| 501 | ms->nextToUpdate = target; |
| 502 | } |
| 503 | |
| 504 | void ZSTD_updateTree(ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iend) { |
| 505 | ZSTD_updateTree_internal(ms, ip, iend, ms->cParams.minMatch, ZSTD_noDict); |
no test coverage detected