mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update ArcCacheTable.cs
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace TEngine.ArcCache
|
namespace TEngine
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adaptive Replacement Cache缓存表。
|
/// Adaptive Replacement Cache缓存表。
|
||||||
@@ -70,7 +70,7 @@ namespace TEngine.ArcCache
|
|||||||
/// <param name="value">值。</param>
|
/// <param name="value">值。</param>
|
||||||
public void PutCache(TKey key, TValue value)
|
public void PutCache(TKey key, TValue value)
|
||||||
{
|
{
|
||||||
QueueNode<TKey, TValue> queueNode = CacheStorageMap[key];
|
CacheStorageMap.TryGetValue(key, out QueueNode<TKey, TValue> queueNode);
|
||||||
|
|
||||||
if (queueNode == null)
|
if (queueNode == null)
|
||||||
{
|
{
|
||||||
@@ -100,7 +100,7 @@ namespace TEngine.ArcCache
|
|||||||
/// <returns>TValue from cache if exists or null。</returns>
|
/// <returns>TValue from cache if exists or null。</returns>
|
||||||
public TValue GetCache(TKey key)
|
public TValue GetCache(TKey key)
|
||||||
{
|
{
|
||||||
QueueNode<TKey, TValue> queueNode = CacheStorageMap[key];
|
CacheStorageMap.TryGetValue(key, out QueueNode<TKey, TValue> queueNode);
|
||||||
|
|
||||||
if (queueNode == null)
|
if (queueNode == null)
|
||||||
{
|
{
|
||||||
@@ -247,7 +247,7 @@ namespace TEngine.ArcCache
|
|||||||
TValue value = queueNodeToBeRemoved.Get();
|
TValue value = queueNodeToBeRemoved.Get();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Dispose(value);
|
OnRemoveCallback?.Invoke(value);
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
{
|
{
|
||||||
@@ -264,7 +264,7 @@ namespace TEngine.ArcCache
|
|||||||
if (keys == "")
|
if (keys == "")
|
||||||
keys += key;
|
keys += key;
|
||||||
else
|
else
|
||||||
keys += ", " + key;
|
keys += " | " + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log("All Existing Keys in Cache are : " + keys);
|
Debug.Log("All Existing Keys in Cache are : " + keys);
|
||||||
|
Reference in New Issue
Block a user