Skip to content

Commit

Permalink
Use Linq instead of 'foreach'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoC0de authored Jul 21, 2024
1 parent 0cb7859 commit 63d8c04
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/NuGetForUnity/Editor/NugetPackageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,7 @@ private static bool Install([NotNull] INugetPackage package, bool refreshAssets,
{
// check if nuget package has contentFiles folder
const string contentFilesDirectoryName = "contentFiles/";
var hasContentFilesFolder = false;
foreach (var entry in zip.Entries)
{
if (entry.FullName.StartsWith(contentFilesDirectoryName, StringComparison.Ordinal))
{
hasContentFilesFolder = true;
break;
}
}
var hasContentFilesFolder = zip.Entries.Any(entry => entry.FullName.StartsWith(contentFilesDirectoryName, StringComparison.Ordinal));

var libs = new Dictionary<string, List<ZipArchiveEntry>>();
var csFiles = new Dictionary<string, List<ZipArchiveEntry>>();
Expand Down

0 comments on commit 63d8c04

Please sign in to comment.