This improved version of the System.Collections.Generic.List that doesn't release the buffer on Clear(), resulting in better performance and less garbage collection. PRO: BetterList performs faster than List when you Add and Remove items (although slower if you remove from the beginning). CON: BetterList performs worse when sorting the list. If your operations involve sorting, use the standard List instead.
More...
|
IEnumerator< T > | GetEnumerator () |
| For 'foreach' functionality. More...
|
|
void | Clear () |
| Clear the array by resetting its size to zero. Note that the memory is not actually released. More...
|
|
void | Release () |
| Clear the array and release the used memory. More...
|
|
void | Add (T item) |
| Add the specified item to the end of the list. More...
|
|
void | Insert (int index, T item) |
| Insert an item at the specified index, pushing the entries back. More...
|
|
bool | Contains (T item) |
| Returns 'true' if the specified item is within the list. More...
|
|
int | IndexOf (T item) |
| Return the index of the specified item. More...
|
|
bool | Remove (T item) |
| Remove the specified item from the list. Note that RemoveAt() is faster and is advisable if you already know the index. More...
|
|
void | RemoveAt (int index) |
| Remove an item at the specified index. More...
|
|
T | Pop () |
| Remove an item from the end. More...
|
|
T[] | ToArray () |
| Mimic List's ToArray() functionality, except that in this case the list is resized to match the current size. More...
|
|
void | Sort (CompareFunc comparer) |
| List.Sort equivalent. Doing Array.Sort causes GC allocations. More...
|
|
delegate int | CompareFunc (T left, T right) |
| Comparison function should return -1 if left is less than right, 1 if left is greater than right, and 0 if they match. More...
|
|
|
T[] | buffer |
| Direct access to the buffer. Note that you should not use its 'Length' parameter, but instead use BetterList.size. More...
|
|
int | size = 0 |
| Direct access to the buffer's size. Note that it's only public for speed and efficiency. You shouldn't modify it. More...
|
|
This improved version of the System.Collections.Generic.List that doesn't release the buffer on Clear(), resulting in better performance and less garbage collection. PRO: BetterList performs faster than List when you Add and Remove items (although slower if you remove from the beginning). CON: BetterList performs worse when sorting the list. If your operations involve sorting, use the standard List instead.
void BetterList< T >.Add |
( |
T |
item | ) |
|
Add the specified item to the end of the list.
void BetterList< T >.Clear |
( |
| ) |
|
Clear the array by resetting its size to zero. Note that the memory is not actually released.
delegate int BetterList< T >.CompareFunc |
( |
T |
left, |
|
|
T |
right |
|
) |
| |
Comparison function should return -1 if left is less than right, 1 if left is greater than right, and 0 if they match.
bool BetterList< T >.Contains |
( |
T |
item | ) |
|
Returns 'true' if the specified item is within the list.
IEnumerator<T> BetterList< T >.GetEnumerator |
( |
| ) |
|
For 'foreach' functionality.
int BetterList< T >.IndexOf |
( |
T |
item | ) |
|
Return the index of the specified item.
void BetterList< T >.Insert |
( |
int |
index, |
|
|
T |
item |
|
) |
| |
Insert an item at the specified index, pushing the entries back.
T BetterList< T >.Pop |
( |
| ) |
|
Remove an item from the end.
void BetterList< T >.Release |
( |
| ) |
|
Clear the array and release the used memory.
bool BetterList< T >.Remove |
( |
T |
item | ) |
|
Remove the specified item from the list. Note that RemoveAt() is faster and is advisable if you already know the index.
void BetterList< T >.RemoveAt |
( |
int |
index | ) |
|
Remove an item at the specified index.
List.Sort equivalent. Doing Array.Sort causes GC allocations.
List.Sort equivalent. Manual sorting causes no GC allocations.
T [] BetterList< T >.ToArray |
( |
| ) |
|
Mimic List's ToArray() functionality, except that in this case the list is resized to match the current size.
T [] BetterList< T >.buffer |
Direct access to the buffer. Note that you should not use its 'Length' parameter, but instead use BetterList.size.
int BetterList< T >.size = 0 |
Direct access to the buffer's size. Note that it's only public for speed and efficiency. You shouldn't modify it.
T BetterList< T >.this[int i] |
|
getset |
Convenience function. I recommend using .buffer instead.
The documentation for this class was generated from the following file: