Skip to content

Commit f93fa82

Browse files
committed
Added CircularBuffer.ToArray (used in one of my projects)
1 parent 58eef32 commit f93fa82

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Plugins/IngameDebugConsole/Scripts/CircularBuffer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public void Add( T value )
2828
startIndex = 0;
2929
}
3030
}
31+
32+
public T[] ToArray()
33+
{
34+
T[] result = new T[Count];
35+
for (int i = 0; i < Count; i++)
36+
result[i] = this[i];
37+
38+
return result;
39+
}
3140
}
3241

3342
public class DynamicCircularBuffer<T>

0 commit comments

Comments
 (0)