Skip to content

Commit 7e1a96c

Browse files
committed
[GH Usage] Removed redundant parameter
1 parent 5ce72e4 commit 7e1a96c

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/NuGetGallery.Core/GitHub/GitHubUsageConfiguration.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ private static IReadOnlyDictionary<string, NuGetPackageGitHubInformation> GetNuG
5656
return dependentsPerPackage
5757
.ToDictionary(
5858
entry => entry.Key,
59-
entry => new NuGetPackageGitHubInformation(
60-
entry.Value.Count,
61-
entry.Value),
59+
entry => new NuGetPackageGitHubInformation(entry.Value),
6260
StringComparer.OrdinalIgnoreCase);
6361
}
6462
}

src/NuGetGallery.Core/GitHub/NuGetPackageGitHubInformation.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,19 @@ public class NuGetPackageGitHubInformation
1111
{
1212
public const int ReposPerPackage = 10;
1313

14-
public readonly static NuGetPackageGitHubInformation Empty = new NuGetPackageGitHubInformation(
15-
0,
16-
new List<RepositoryInformation>());
14+
public readonly static NuGetPackageGitHubInformation Empty = new NuGetPackageGitHubInformation(new List<RepositoryInformation>());
1715

18-
public NuGetPackageGitHubInformation(int totalRepos, IReadOnlyList<RepositoryInformation> repos)
16+
public NuGetPackageGitHubInformation(IReadOnlyList<RepositoryInformation> repos)
1917
{
20-
if (totalRepos < 0)
21-
{
22-
throw new IndexOutOfRangeException(string.Format("{0} cannot have a negative value!", nameof(totalRepos)));
23-
}
24-
2518
if( repos == null)
2619
{
2720
throw new ArgumentNullException(nameof(repos));
2821
}
2922

30-
TotalRepos = totalRepos;
23+
TotalRepos = repos.Count;
3124
Repos = repos
3225
.OrderByDescending(x => x.Stars)
33-
.ThenBy(x => x.Id)
26+
.ThenBy(x => x.Id, StringComparer.OrdinalIgnoreCase)
3427
.Take(ReposPerPackage)
3528
.ToList();
3629
}

0 commit comments

Comments
 (0)