Skip to content

Commit 61d0f7b

Browse files
Copilotericstj
andcommitted
Refine deduplication logic with improved error handling and cleaner output
Co-authored-by: ericstj <[email protected]>
1 parent d1d62ab commit 61d0f7b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/SourceBrowser/src/BinLogToSln/Program.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ private static CompilerInvocation SelectBestInvocation(IGrouping<string, Compile
2424
return invocations[0];
2525
}
2626

27-
Console.WriteLine($"Selecting best invocation for assembly '{invocationGroup.Key}' from {invocations.Count} candidates:");
28-
foreach (var inv in invocations)
29-
{
30-
Console.WriteLine($" - {inv.ProjectFilePath}");
31-
}
27+
Console.WriteLine($"Found {invocations.Count} candidates for assembly '{invocationGroup.Key}', selecting best...");
3228

3329
// Score each invocation based on our criteria
3430
var scoredInvocations = invocations.Select(inv => new
@@ -40,7 +36,7 @@ private static CompilerInvocation SelectBestInvocation(IGrouping<string, Compile
4036
// Select the highest scored invocation
4137
var best = scoredInvocations.OrderByDescending(x => x.Score).First();
4238

43-
Console.WriteLine($"Selected: {best.Invocation.ProjectFilePath} (score: {best.Score})");
39+
Console.WriteLine($"Selected '{best.Invocation.ProjectFilePath}' (score: {best.Score})");
4440
return best.Invocation;
4541
}
4642

@@ -86,7 +82,7 @@ private static int CalculateInvocationScore(CompilerInvocation invocation)
8682
}
8783
catch (Exception ex)
8884
{
89-
Console.WriteLine($"Error calculating score for {invocation.ProjectFilePath}: {ex.Message}");
85+
Console.WriteLine($"Warning: Error calculating score for {invocation.ProjectFilePath}: {ex.Message}");
9086
// Return a base score so we don't exclude this invocation entirely
9187
score = 1;
9288
}

0 commit comments

Comments
 (0)