mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
性能优化
This commit is contained in:
33
Runtime/Internal/SerieDataPool.cs
Normal file
33
Runtime/Internal/SerieDataPool.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
internal static class SerieDataPool
|
||||
{
|
||||
private static readonly ObjectPool<SerieData> s_ListPool = new ObjectPool<SerieData>(null, OnClear);
|
||||
|
||||
static void OnGet(SerieData serieData)
|
||||
{
|
||||
}
|
||||
|
||||
static void OnClear(SerieData serieData)
|
||||
{
|
||||
serieData.Clear();
|
||||
}
|
||||
|
||||
public static SerieData Get()
|
||||
{
|
||||
return s_ListPool.Get();
|
||||
}
|
||||
|
||||
public static void Release(SerieData toRelease)
|
||||
{
|
||||
s_ListPool.Release(toRelease);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user