Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
Async Task vs Async void
Creado
hace 2 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
11 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
80 líneas
Copiar todo
8 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
78 líneas
Copiar todo
public class MyClass
public class MyClass
{
{
[CompilerGenerated]
[CompilerGenerated]
Copiar
Copiado
Copiar
Copiado
private sealed class <
NormalAsync
>d__0 : IAsyncStateMachine
private sealed class <
AsyncVoid
>d__0 : IAsyncStateMachine
{
{
public int <>1__state;
public int <>1__state;
Copiar
Copiado
Copiar
Copiado
public Async
Task
MethodBuilder <>t__builder;
public Async
Void
MethodBuilder <>t__builder;
public MyClass <>4__this;
public MyClass <>4__this;
private YieldAwaitable.YieldAwaiter <>u__1;
private YieldAwaitable.YieldAwaiter <>u__1;
private void MoveNext()
private void MoveNext()
{
{
int num = <>1__state;
int num = <>1__state;
try
try
{
{
YieldAwaitable.YieldAwaiter awaiter;
YieldAwaitable.YieldAwaiter awaiter;
if (num != 0)
if (num != 0)
{
{
awaiter = Task.Yield().GetAwaiter();
awaiter = Task.Yield().GetAwaiter();
if (!awaiter.IsCompleted)
if (!awaiter.IsCompleted)
{
{
num = (<>1__state = 0);
num = (<>1__state = 0);
<>u__1 = awaiter;
<>u__1 = awaiter;
Copiar
Copiado
Copiar
Copiado
<
NormalAsync
>d__0 stateMachine = this;
<
AsyncVoid
>d__0 stateMachine = this;
<>t__builder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
<>t__builder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
return;
return;
}
}
}
}
else
else
{
{
awaiter = <>u__1;
awaiter = <>u__1;
<>u__1 = default(YieldAwaitable.YieldAwaiter);
<>u__1 = default(YieldAwaitable.YieldAwaiter);
num = (<>1__state = -1);
num = (<>1__state = -1);
}
}
awaiter.GetResult();
awaiter.GetResult();
}
}
catch (Exception exception)
catch (Exception exception)
{
{
<>1__state = -2;
<>1__state = -2;
<>t__builder.SetException(exception);
<>t__builder.SetException(exception);
return;
return;
}
}
<>1__state = -2;
<>1__state = -2;
<>t__builder.SetResult();
<>t__builder.SetResult();
}
}
void IAsyncStateMachine.MoveNext()
void IAsyncStateMachine.MoveNext()
{
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
this.MoveNext();
this.MoveNext();
}
}
[DebuggerHidden]
[DebuggerHidden]
private void SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine)
private void SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine)
{
{
}
}
void IAsyncStateMachine.SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine)
void IAsyncStateMachine.SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine)
{
{
//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
this.SetStateMachine(stateMachine);
this.SetStateMachine(stateMachine);
}
}
}
}
Copiar
Copiado
Copiar
Copiado
[NullableContext(1)]
[AsyncStateMachine(typeof(<
AsyncVoid
>d__0))]
[AsyncStateMachine(typeof(<
NormalAsync
>d__0))]
[DebuggerStepThrough]
[DebuggerStepThrough]
Copiar
Copiado
Copiar
Copiado
public
Task NormalAsync
()
public
void AsyncVoid
()
{
{
Copiar
Copiado
Copiar
Copiado
<
NormalAsync
>d__0 stateMachine = new <
NormalAsync
>d__0();
<
AsyncVoid
>d__0 stateMachine = new <
AsyncVoid
>d__0();
stateMachine.<>t__builder = Async
Task
MethodBuilder.Create();
stateMachine.<>t__builder = Async
Void
MethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.<>4__this = this;
stateMachine.<>1__state = -1;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
stateMachine.<>t__builder.Start(ref stateMachine);
Copiar
Copiado
Copiar
Copiado
return stateMachine.<>t__builder.Task;
}
}
}
}
Diferencias guardadas
Texto original
Abrir archivo
public class MyClass { [CompilerGenerated] private sealed class <NormalAsync>d__0 : IAsyncStateMachine { public int <>1__state; public AsyncTaskMethodBuilder <>t__builder; public MyClass <>4__this; private YieldAwaitable.YieldAwaiter <>u__1; private void MoveNext() { int num = <>1__state; try { YieldAwaitable.YieldAwaiter awaiter; if (num != 0) { awaiter = Task.Yield().GetAwaiter(); if (!awaiter.IsCompleted) { num = (<>1__state = 0); <>u__1 = awaiter; <NormalAsync>d__0 stateMachine = this; <>t__builder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine); return; } } else { awaiter = <>u__1; <>u__1 = default(YieldAwaitable.YieldAwaiter); num = (<>1__state = -1); } awaiter.GetResult(); } catch (Exception exception) { <>1__state = -2; <>t__builder.SetException(exception); return; } <>1__state = -2; <>t__builder.SetResult(); } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } [DebuggerHidden] private void SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine) { } void IAsyncStateMachine.SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(stateMachine); } } [NullableContext(1)] [AsyncStateMachine(typeof(<NormalAsync>d__0))] [DebuggerStepThrough] public Task NormalAsync() { <NormalAsync>d__0 stateMachine = new <NormalAsync>d__0(); stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create(); stateMachine.<>4__this = this; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } }
Texto modificado
Abrir archivo
public class MyClass { [CompilerGenerated] private sealed class <AsyncVoid>d__0 : IAsyncStateMachine { public int <>1__state; public AsyncVoidMethodBuilder <>t__builder; public MyClass <>4__this; private YieldAwaitable.YieldAwaiter <>u__1; private void MoveNext() { int num = <>1__state; try { YieldAwaitable.YieldAwaiter awaiter; if (num != 0) { awaiter = Task.Yield().GetAwaiter(); if (!awaiter.IsCompleted) { num = (<>1__state = 0); <>u__1 = awaiter; <AsyncVoid>d__0 stateMachine = this; <>t__builder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine); return; } } else { awaiter = <>u__1; <>u__1 = default(YieldAwaitable.YieldAwaiter); num = (<>1__state = -1); } awaiter.GetResult(); } catch (Exception exception) { <>1__state = -2; <>t__builder.SetException(exception); return; } <>1__state = -2; <>t__builder.SetResult(); } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } [DebuggerHidden] private void SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine) { } void IAsyncStateMachine.SetStateMachine([Nullable(1)] IAsyncStateMachine stateMachine) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(stateMachine); } } [AsyncStateMachine(typeof(<AsyncVoid>d__0))] [DebuggerStepThrough] public void AsyncVoid() { <AsyncVoid>d__0 stateMachine = new <AsyncVoid>d__0(); stateMachine.<>t__builder = AsyncVoidMethodBuilder.Create(); stateMachine.<>4__this = this; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); } }
Encontrar la diferencia