Skip to content

Commit ffe469c

Browse files
committed
Do not use LINQ over the array
1 parent baf6c19 commit ffe469c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

src/RecyclableMemoryStreamManager.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,36 @@ public RecyclableMemoryStreamManager(int blockSize, int largeBufferMultiple, int
183183
/// <summary>
184184
/// Number of bytes in large pool not currently in use
185185
/// </summary>
186-
public long LargePoolFreeSize => this.largeBufferFreeSize.Sum();
186+
public long LargePoolFreeSize
187+
{
188+
get
189+
{
190+
long sum = 0;
191+
foreach (long freeSize in this.largeBufferFreeSize)
192+
{
193+
sum += freeSize;
194+
}
195+
196+
return sum;
197+
}
198+
}
187199

188200
/// <summary>
189201
/// Number of bytes currently in use by streams from the large pool
190202
/// </summary>
191-
public long LargePoolInUseSize => this.largeBufferInUseSize.Sum();
203+
public long LargePoolInUseSize
204+
{
205+
get
206+
{
207+
long sum = 0;
208+
foreach (long inUseSize in this.largeBufferInUseSize)
209+
{
210+
sum += inUseSize;
211+
}
212+
213+
return sum;
214+
}
215+
}
192216

193217
/// <summary>
194218
/// How many blocks are in the small pool

0 commit comments

Comments
 (0)