/************************************************/ /* */ /* Copyright (c) 2018 - 2021 monitor1394 */ /* https://github.com/monitor1394 */ /* */ /************************************************/ using System.Collections.Generic; using UnityEngine; namespace XCharts { internal static class ListPool { private static readonly ObjectPool> s_ListPool = new ObjectPool>(OnGet, OnClear); static void OnGet(List l) { if (l.Capacity < 50) { l.Capacity = 50; } } static void OnClear(List l) { l.Clear(); } public static List Get() { return s_ListPool.Get(); } public static void Release(List toRelease) { s_ListPool.Release(toRelease); } public static void ClearAll() { s_ListPool.ClearAll(); } } }