Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0c96b7b

Browse files
authored
Merge pull request #13390 from stephentoub/avtmbcreate
Remove overhead from AsyncValueTaskMethodBuilder.Create
2 parents d92c1e0 + 5dcf28b commit 0c96b7b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/mscorlib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public struct AsyncValueTaskMethodBuilder<TResult>
2525
/// <summary>Creates an instance of the <see cref="AsyncValueTaskMethodBuilder{TResult}"/> struct.</summary>
2626
/// <returns>The initialized instance.</returns>
2727
public static AsyncValueTaskMethodBuilder<TResult> Create() =>
28-
new AsyncValueTaskMethodBuilder<TResult>() { _methodBuilder = AsyncTaskMethodBuilder<TResult>.Create() };
28+
default(AsyncValueTaskMethodBuilder<TResult>);
2929

3030
/// <summary>Begins running the builder with the associated state machine.</summary>
3131
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>

src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,9 @@ public struct AsyncTaskMethodBuilder<TResult>
431431
public static AsyncTaskMethodBuilder<TResult> Create()
432432
{
433433
return default(AsyncTaskMethodBuilder<TResult>);
434-
// NOTE: If this method is ever updated to perform more initialization,
435-
// ATMB.Create must also be updated to call this Create method.
434+
// NOTE: If this method is ever updated to perform more initialization,
435+
// other Create methods like AsyncTaskMethodBuilder.Create and
436+
// AsyncValueTaskMethodBuilder.Create must be updated to call this.
436437
}
437438

438439
/// <summary>Initiates the builder's execution with the associated state machine.</summary>

0 commit comments

Comments
 (0)