Skip to content

Commit eac1f7a

Browse files
committed
Remove unused code
1 parent 2b17fa5 commit eac1f7a

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

LLama/Common/FixedSizeQueue.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,34 +125,6 @@ IEnumerator IEnumerable.GetEnumerator()
125125
return GetEnumerator();
126126
}
127127

128-
/// <summary>
129-
/// Returns up to <paramref name="count"/> of the most recent items as a contiguous span.
130-
/// </summary>
131-
internal ReadOnlySpan<T> AsSpan(int count)
132-
{
133-
count = Math.Min(count, _count);
134-
if (count == 0)
135-
return ReadOnlySpan<T>.Empty;
136-
137-
var start = (_start + _count - count + Capacity) % Capacity;
138-
139-
if (start + count <= Capacity)
140-
{
141-
return new ReadOnlySpan<T>(_buffer, start, count);
142-
}
143-
144-
_window ??= new T[Math.Min(Capacity, Math.Max(MinimumWindowSize, count))];
145-
if (_window.Length < count)
146-
{
147-
Array.Resize(ref _window, Math.Min(Capacity, Math.Max(_window.Length * WindowGrowthFactor, count)));
148-
}
149-
150-
var firstSegmentLength = Capacity - start;
151-
Array.Copy(_buffer, start, _window, 0, firstSegmentLength);
152-
Array.Copy(_buffer, 0, _window, firstSegmentLength, count - firstSegmentLength);
153-
return _window.AsSpan(0, count);
154-
}
155-
156128
private IEnumerable<T> Enumerate()
157129
{
158130
for (var i = 0; i < _count; i++)

0 commit comments

Comments
 (0)