mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Use CheckExists function
This commit is contained in:
parent
9bb32f0914
commit
d3a303e251
@ -26,7 +26,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="token">An optional <see cref="CancellationToken"/> to cancel the operation.</param>
|
/// <param name="token">An optional <see cref="CancellationToken"/> to cancel the operation.</param>
|
||||||
protected async Task<TValue> GetAsync([NotNull] TLookup lookup, CancellationToken token = default)
|
protected async Task<TValue> GetAsync([NotNull] TLookup lookup, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
if (cache.TryGetValue(lookup, out TValue performance))
|
if (CheckExists(lookup, out TValue performance))
|
||||||
return performance;
|
return performance;
|
||||||
|
|
||||||
var computed = await ComputeValueAsync(lookup, token);
|
var computed = await ComputeValueAsync(lookup, token);
|
||||||
|
Loading…
Reference in New Issue
Block a user