C#: Inline some calls.

This commit is contained in:
Michael Nebel
2024-04-12 15:34:49 +02:00
parent 611cf231a7
commit f7e5fe7040

View File

@@ -623,13 +623,9 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private (HashSet<string> explicitFeeds, HashSet<string> allFeeds) GetAllFeeds()
{
IList<string> GetNugetFeeds(string nugetConfig) => dotnet.GetNugetFeeds(nugetConfig);
IList<string> GetNugetFeedsFromFolder(string folderPath) => dotnet.GetNugetFeedsFromFolder(folderPath);
var nugetConfigs = fileProvider.NugetConfigs;
var explicitFeeds = nugetConfigs
.SelectMany(config => GetFeeds(() => GetNugetFeeds(config)))
.SelectMany(config => GetFeeds(() => dotnet.GetNugetFeeds(config)))
.ToHashSet();
if (explicitFeeds.Count > 0)
@@ -657,7 +653,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
return null;
})
.Where(folder => folder != null)
.SelectMany(folder => GetFeeds(() => GetNugetFeedsFromFolder(folder!)))
.SelectMany(folder => GetFeeds(() => dotnet.GetNugetFeedsFromFolder(folder!)))
.ToHashSet();
logger.LogInfo($"Found {allFeeds.Count} Nuget feeds (with inherited ones) in nuget.config files: {string.Join(", ", allFeeds.OrderBy(f => f))}");