1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Add xmldoc and update parameter naming for MemoryCachingComponent.Invalidate flow

This commit is contained in:
Dean Herbert 2022-06-30 17:17:06 +09:00
parent aab4dcefbd
commit 2a73210865

View File

@ -40,11 +40,15 @@ namespace osu.Game.Database
return computed;
}
protected void Invalidate(Func<TLookup, bool> invalidationFunction)
/// <summary>
/// Invalidate all entries matching a provided predicate.
/// </summary>
/// <param name="matchKeyPredicate">The predicate to decide which keys should be invalidated.</param>
protected void Invalidate(Func<TLookup, bool> matchKeyPredicate)
{
foreach (var kvp in cache)
{
if (invalidationFunction(kvp.Key))
if (matchKeyPredicate(kvp.Key))
cache.TryRemove(kvp.Key, out _);
}
}