IntelliTect / IntelliTect/CodingGuidelines

Flag Task.Delay(0) as being Task.CompletedTask

Abierto
#55 2 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement Hacktoberfest
Lenguaje dominante
C#
Estrellas
12
Forks
16
Merge medio
2 min
PR fusionados (30 d)
7

Descripción

Task.Delay(0) is the same as Task.CompletedTask
[.NET Core](https://source.dot.net/#System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs,5396)
[.NET Framework](https://referencesource.microsoft.com/#mscorlib/system/threading/Tasks/Task.cs,5881)

Test cases:
```
Task.Delay(0);
Task.Delay(0, token);
```

Suggest:
We should suggest changing to `Task.CompletedTask` since that is what is going to happen anyway.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Read the linked .NET Core and .NET Framework Task implementations, then use the two listed Task.Delay cases as the behavior to verify. Locate the repository's diagnostic entry point and ensure both cases are flagged with a suggestion to use Task.CompletedTask; done means the diagnostics and their tests cover both forms.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.