Skip to content

Commit b1a6cfa

Browse files
ak88brantburnett
andauthored
check table size greater than (#77)
Check if table size is greater than buffer length, instead of the other way around. I run into an exception because i am flushing my compressor, and then write a chunk that is bigger, than what the buffer is can contain. Co-authored-by: Brant Burnett <bburnett@centeredgesoftware.com>
1 parent a0c6ce1 commit b1a6cfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Snappier/Internal/HashTable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void EnsureCapacity(int inputSize)
2525
var maxFragmentSize = Math.Min(inputSize, (int) Constants.BlockSize);
2626
var tableSize = CalculateTableSize(maxFragmentSize);
2727

28-
if (_buffer is null || tableSize < _buffer.Length)
28+
if (_buffer is null || tableSize > _buffer.Length)
2929
{
3030
if (_buffer is not null)
3131
{

0 commit comments

Comments
 (0)