Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 6e4bdb5

Browse files
committed
Using from result to avoid spinning threads on completed tasks
1 parent 5d89039 commit 6e4bdb5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/GitHub.Api/Git/GitClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ public ITask<ValidateGitInstallResult> ValidateGitInstall(string path)
175175
{
176176
if (!path.ToNPath().FileExists())
177177
{
178-
return new FuncTask<ValidateGitInstallResult>(cancellationToken,
179-
() => new ValidateGitInstallResult(false, null, null));
178+
return new FuncTask<ValidateGitInstallResult>(TaskEx.FromResult(new ValidateGitInstallResult(false, null, null)));
180179
}
181180

182181
Version gitVersion = null;

0 commit comments

Comments
 (0)