Skip to content

Commit

Permalink
Sanity check for block cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Dec 1, 2023
1 parent 13bfdb7 commit 043a4af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Shared/BlockCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ private bool Dequeue(out Block? block)

public void Resize(int newSize)
{
if (newSize < 0)
newSize = 0;
_maxSize = newSize;
while (blocks.Count > _maxSize)
{
Expand Down

0 comments on commit 043a4af

Please sign in to comment.