This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
shared/System/Threading/Tasks
src/System/Runtime/CompilerServices Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ public Task<TResult> AsTask() =>
114
114
// Return the task if we were constructed from one, otherwise manufacture one. We don't
115
115
// cache the generated task into _task as it would end up changing both equality comparison
116
116
// and the hash code we generate in GetHashCode.
117
- _task ?? Task . FromResult ( _result ) ;
117
+ _task ?? AsyncTaskMethodBuilder < TResult > . GetTaskForResult ( _result ) ;
118
118
119
119
/// <summary>Gets whether the <see cref="ValueTask{TResult}"/> represents a completed operation.</summary>
120
120
public bool IsCompleted => _task == null || _task . IsCompleted ;
Original file line number Diff line number Diff line change @@ -719,7 +719,7 @@ internal void SetNotificationForWaitCompletion(bool enabled)
719
719
/// <param name="result">The result for which we need a task.</param>
720
720
/// <returns>The completed task containing the result.</returns>
721
721
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] // method looks long, but for a given TResult it results in a relatively small amount of asm
722
- private Task < TResult > GetTaskForResult ( TResult result )
722
+ internal static Task < TResult > GetTaskForResult ( TResult result )
723
723
{
724
724
Contract . Ensures (
725
725
EqualityComparer < TResult > . Default . Equals ( result , Contract . Result < Task < TResult > > ( ) . Result ) ,
You can’t perform that action at this time.
0 commit comments