Skip to content

Commit

Permalink
Do not use LINQ over the array
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrwrbgs committed Jun 5, 2018
1 parent baf6c19 commit ffe469c
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/RecyclableMemoryStreamManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,36 @@ public RecyclableMemoryStreamManager(int blockSize, int largeBufferMultiple, int
/// <summary>
/// Number of bytes in large pool not currently in use
/// </summary>
public long LargePoolFreeSize => this.largeBufferFreeSize.Sum();
public long LargePoolFreeSize
{
get
{
long sum = 0;
foreach (long freeSize in this.largeBufferFreeSize)
{
sum += freeSize;
}

return sum;
}
}

/// <summary>
/// Number of bytes currently in use by streams from the large pool
/// </summary>
public long LargePoolInUseSize => this.largeBufferInUseSize.Sum();
public long LargePoolInUseSize
{
get
{
long sum = 0;
foreach (long inUseSize in this.largeBufferInUseSize)
{
sum += inUseSize;
}

return sum;
}
}

/// <summary>
/// How many blocks are in the small pool
Expand Down

0 comments on commit ffe469c

Please sign in to comment.