IntelliTect / IntelliTect/CodingGuidelines

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

Aperta
#55 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement Hacktoberfest
Lingua principale
C#
Stelle
12
Fork
16
Merge medio
2m
PR unite (30g)
7

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.