26 lines
376 B
C#
26 lines
376 B
C#
using System;
|
|
|
|
namespace DebuggingEssentials
|
|
{
|
|
[Serializable]
|
|
public class FastCacheList<T> : FastList<T> where T : new()
|
|
{
|
|
public FastCacheList(int capacity)
|
|
: base(capacity)
|
|
{
|
|
}
|
|
|
|
public T GetItem()
|
|
{
|
|
if (_count == 0)
|
|
{
|
|
return new T();
|
|
}
|
|
T result = items[--_count];
|
|
items[_count] = default(T);
|
|
Count = _count;
|
|
return result;
|
|
}
|
|
}
|
|
}
|