Optimize GC for RMV pool.

This commit is contained in:
2023-01-01 19:03:19 +08:00
parent cf6186aa16
commit 2b5bc5dd08
2 changed files with 6 additions and 2 deletions

View File

@@ -219,7 +219,7 @@ namespace Cryville.Crtr.Event {
if (!CachedValues.TryGetValue(key, out tr))
CachedValues.Add(key, tr = new CacheEntry { Valid = false });
if (tr.Value == null)
tr.Value = (Vector)ReflectionHelper.InvokeEmptyConstructor(ChartPlayer.motionRegistry[key].Type);
tr.Value = RMVPool.Rent(key).AbsoluteValue;
Vector r = tr.Value;
#if !DISABLE_CACHE
if (tr.Valid) return r;