Skip to content

Commit 097e6af

Browse files
committed
Prefer to avoid reassignment and creation of unused objects
1 parent ce58bf9 commit 097e6af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/TfvcMigrator/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public static async Task MigrateAsync(
8787

8888
Console.WriteLine("Connecting...");
8989

90-
var vssCredentials = new VssCredentials();
91-
if (!string.IsNullOrEmpty(pat))
92-
vssCredentials = new VssBasicCredential(string.Empty, pat);
90+
var vssCredentials = !string.IsNullOrEmpty(pat)
91+
? new VssBasicCredential(string.Empty, pat)
92+
: new VssCredentials();
9393

9494
using var connection = new VssConnection(projectCollectionUrl, vssCredentials);
9595
using var client = await connection.GetClientAsync<TfvcHttpClient>();

0 commit comments

Comments
 (0)