mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 10:11:38 -06:00
4.23
This commit is contained in:
committed by
Kornel Lesiński
parent
3c510ba80b
commit
ac2b563958
@@ -384,7 +384,7 @@ STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
|
||||
if (prop.vt != VT_UI4)
|
||||
return E_INVALIDARG;
|
||||
UInt32 numFastBytes = prop.ulVal;
|
||||
if(numFastBytes < 2 || numFastBytes > kMatchMaxLen)
|
||||
if(numFastBytes < 5 || numFastBytes > kMatchMaxLen)
|
||||
return E_INVALIDARG;
|
||||
_numFastBytes = numFastBytes;
|
||||
break;
|
||||
@@ -652,18 +652,14 @@ HRESULT CEncoder::GetOptimum(UInt32 position, UInt32 &backRes, UInt32 &lenRes)
|
||||
{
|
||||
backRes = repMaxIndex;
|
||||
lenRes = repLens[repMaxIndex];
|
||||
MovePos(lenRes - 1);
|
||||
return S_OK;
|
||||
return MovePos(lenRes - 1);
|
||||
}
|
||||
|
||||
if(lenMain > _numFastBytes)
|
||||
{
|
||||
UInt32 backMain = (lenMain < _numFastBytes) ? _matchDistances[lenMain] :
|
||||
_matchDistances[_numFastBytes];
|
||||
backRes = backMain + kNumRepDistances;
|
||||
MovePos(lenMain - 1);
|
||||
backRes = _matchDistances[_numFastBytes] + kNumRepDistances;
|
||||
lenRes = lenMain;
|
||||
return S_OK;
|
||||
return MovePos(lenMain - 1);
|
||||
}
|
||||
Byte currentByte = _matchFinder->GetIndexByte(0 - 1);
|
||||
|
||||
@@ -1099,15 +1095,13 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
|
||||
{
|
||||
backRes = repMaxIndex;
|
||||
lenRes = repLens[repMaxIndex];
|
||||
MovePos(lenRes - 1);
|
||||
return S_OK;
|
||||
return MovePos(lenRes - 1);
|
||||
}
|
||||
if(lenMain >= _numFastBytes)
|
||||
{
|
||||
backRes = _matchDistances[_numFastBytes] + kNumRepDistances;
|
||||
MovePos(lenMain - 1);
|
||||
lenRes = lenMain;
|
||||
return S_OK;
|
||||
return MovePos(lenMain - 1);
|
||||
}
|
||||
while (lenMain > 2)
|
||||
{
|
||||
@@ -1126,8 +1120,7 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
|
||||
{
|
||||
backRes = repMaxIndex;
|
||||
lenRes = repLens[repMaxIndex];
|
||||
MovePos(lenRes - 1);
|
||||
return S_OK;
|
||||
return MovePos(lenRes - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,9 +1156,8 @@ HRESULT CEncoder::GetOptimumFast(UInt32 position, UInt32 &backRes, UInt32 &lenRe
|
||||
}
|
||||
}
|
||||
backRes = backMain + kNumRepDistances;
|
||||
MovePos(lenMain - 2);
|
||||
lenRes = lenMain;
|
||||
return S_OK;
|
||||
return MovePos(lenMain - 2);
|
||||
}
|
||||
backRes = UInt32(-1);
|
||||
lenRes = 1;
|
||||
|
||||
Reference in New Issue
Block a user