mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08: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;
|
||||
}
|
||||
|
||||
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 _);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user