mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 16:47:19 +09:00
Add xmldoc and update parameter naming for MemoryCachingComponent.Invalidate
flow
This commit is contained in:
parent
aab4dcefbd
commit
2a73210865
@ -40,11 +40,15 @@ namespace osu.Game.Database
|
|||||||
return computed;
|
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)
|
foreach (var kvp in cache)
|
||||||
{
|
{
|
||||||
if (invalidationFunction(kvp.Key))
|
if (matchKeyPredicate(kvp.Key))
|
||||||
cache.TryRemove(kvp.Key, out _);
|
cache.TryRemove(kvp.Key, out _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user