fix: Fixes GetAllSharedAccounts and other list conversions in AdminGump (#1422)
--------- Co-authored-by: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
This commit is contained in:
parent
27e00cc73f
commit
3825b16132
2 changed files with 100 additions and 110 deletions
|
|
@ -806,6 +806,27 @@ public static class Utility
|
|||
return outputList;
|
||||
}
|
||||
|
||||
// ToArray returns an array containing the contents of the List.
|
||||
// This requires copying the List, which is an O(n) operation.
|
||||
public static List<R> ToList<T, R>(this PooledRefList<T> poolList) where T : R
|
||||
{
|
||||
var size = poolList._size;
|
||||
var items = poolList._items;
|
||||
|
||||
var list = new List<R>(size);
|
||||
if (size == 0)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
|
||||
for (var i = 0; i < items.Length; i++)
|
||||
{
|
||||
list.Add(items[i]);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static bool ToBoolean(string value) =>
|
||||
bool.TryParse(value, out var b)
|
||||
? b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue