Skip to content

Commit cedb4fe

Browse files
committed
Use default compressor for rsizetable
1 parent e166d9f commit cedb4fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Helpers/ZStdHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ namespace Totk.ZStdTool.Helpers;
55

66
public class ZStdHelper
77
{
8+
private static readonly Decompressor _defaultDecompressor = new();
89
private static readonly Decompressor _commonDecompressor = new();
910
private static readonly Decompressor _mapDecompressor = new();
1011
private static readonly Decompressor _packDecompressor = new();
12+
private static readonly Compressor _defaultCompressor = new(16);
1113
private static readonly Compressor _commonCompressor = new(16);
1214
private static readonly Compressor _mapCompressor = new(16);
1315
private static readonly Compressor _packCompressor = new(16);
@@ -32,6 +34,7 @@ public static Span<byte> Decompress(string file)
3234
return
3335
file.EndsWith(".bcett.byml.zs") ? _mapDecompressor.Unwrap(src) :
3436
file.EndsWith(".pack.zs") ? _packDecompressor.Unwrap(src) :
37+
file.EndsWith(".rsizetable.zs") ? _defaultDecompressor.Unwrap(src) :
3538
_commonDecompressor.Unwrap(src);
3639
}
3740
public static Span<byte> Compress(string file)
@@ -40,6 +43,7 @@ public static Span<byte> Compress(string file)
4043
return
4144
file.EndsWith(".bcett.byml") ? _mapCompressor.Wrap(src) :
4245
file.EndsWith(".pack") ? _packCompressor.Wrap(src) :
46+
file.EndsWith(".rsizetable") ? _defaultCompressor.Wrap(src) :
4347
_commonCompressor.Wrap(src);
4448
}
4549

0 commit comments

Comments
 (0)