We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d18915a commit e258d9fCopy full SHA for e258d9f
csharp/extractor/Semmle.Extraction/LocationExtensions.cs
@@ -76,7 +76,7 @@ private static bool BetterThan(Location l1, Location l2)
76
/// lexicographically smaller filepath and span is considered better.
77
/// </summary>
78
public static Location? BestOrDefault(this IEnumerable<Location> locations) =>
79
- locations.Any() ? locations.Aggregate((best, loc) => BetterThan(best, loc) ? best : loc) : null;
+ locations.Any() ? locations.Aggregate((best, loc) => BetterThan(loc, best) ? loc : best) : null;
80
81
public static Location Best(this IEnumerable<Location> locations) =>
82
locations.BestOrDefault() ?? throw new ArgumentException("No location found.");
0 commit comments