Skip to content

Commit

Permalink
Remove sevenzip In/Out buffer, add comment for code changed by SK
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Aug 13, 2024
1 parent 235e94c commit 3541742
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 130 deletions.
74 changes: 0 additions & 74 deletions SteamKit2/SteamKit2/Util/LZMA/Common/InBuffer.cs

This file was deleted.

49 changes: 0 additions & 49 deletions SteamKit2/SteamKit2/Util/LZMA/Common/OutBuffer.cs

This file was deleted.

14 changes: 7 additions & 7 deletions SteamKit2/SteamKit2/Util/LZMA/Compress/LZMA/LzmaDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, uint pos, byte

uint m_PosStateMask;

bool m_AllowIllegalStreamStart;
bool m_AllowIllegalStreamStart; // Added by SteamKit

public Decoder()
{
Expand All @@ -168,10 +168,10 @@ public Decoder()
m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits);
}

public Decoder(bool allowIllegalStreamStart) : this()
{
m_AllowIllegalStreamStart = allowIllegalStreamStart;
}
public Decoder(bool allowIllegalStreamStart) : this() // Added by SteamKit
{
m_AllowIllegalStreamStart = allowIllegalStreamStart;
}

void SetDictionarySize(uint dictionarySize)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,

UInt64 nowPos64 = 0;
UInt64 outSize64 = (UInt64)outSize;

if (nowPos64 < outSize64 && !m_AllowIllegalStreamStart)
{
if (m_IsMatchDecoders[state.Index << Base.kNumPosStatesBitsMax].Decode(m_RangeDecoder) != 0)
Expand All @@ -260,7 +260,7 @@ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
while (nowPos64 < outSize64)
{
// UInt64 next = Math.Min(nowPos64 + (1 << 18), outSize64);
// while(nowPos64 < next)
// while(nowPos64 < next)
{
uint posState = (uint)nowPos64 & m_PosStateMask;
if (m_IsMatchDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
Expand Down

0 comments on commit 3541742

Please sign in to comment.