You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.
I'm not sure how well to enforce this, because the anti-patterns are very diverse, and subtle.
During coded reviews I've seen code (often in mocks for tests) that use some form of task construction and execution (like Task.Run()) to produce a result when Task.FromResult() would have been much cleaner.
The text was updated successfully, but these errors were encountered:
Another obvious case is when the contents of the lambda body passed to Run are constant. In that case there isn't really a plausible argument for scheduling a task to return a constant value. Task.FromResult is a much better option
I'm not sure how well to enforce this, because the anti-patterns are very diverse, and subtle.
During coded reviews I've seen code (often in mocks for tests) that use some form of task construction and execution (like Task.Run()) to produce a result when Task.FromResult() would have been much cleaner.
The text was updated successfully, but these errors were encountered: