aspnetcore/src/Microsoft.AspNetCore.Mvc.Core/Internal/TaskCache.cs

21 lines
689 B
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Mvc.Internal
{
public static class TaskCache
{
/// <summary>
/// A <see cref="Task"/> that's already completed successfully.
/// </summary>
/// <remarks>
/// We're caching this in a static readonly field to make it more inlinable and avoid the volatile lookup done
/// by <c>Task.CompletedTask</c>.
/// </remarks>
public static readonly Task CompletedTask = Task.CompletedTask;
}
}