1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- #nullable disable
5
-
6
4
using NuGet . Frameworks ;
7
5
using NuGet . RuntimeModel ;
8
6
@@ -27,7 +25,7 @@ public static bool IsPlaceholderFile(string path)
27
25
return separator == '\\ ' || separator == '/' ;
28
26
}
29
27
30
- public static string GetLockFileLanguageName ( string projectLanguage )
28
+ public static string ? GetLockFileLanguageName ( string ? projectLanguage )
31
29
{
32
30
switch ( projectLanguage )
33
31
{
@@ -37,7 +35,7 @@ public static string GetLockFileLanguageName(string projectLanguage)
37
35
}
38
36
}
39
37
40
- public static NuGetFramework ParseFrameworkName ( string frameworkName )
38
+ public static NuGetFramework ? ParseFrameworkName ( string ? frameworkName )
41
39
{
42
40
return frameworkName == null ? null : NuGetFramework . Parse ( frameworkName ) ;
43
41
}
@@ -75,24 +73,24 @@ bool FileMatchesProjectLanguage()
75
73
return IsAnalyzer ( ) && FileMatchesProjectLanguage ( ) ;
76
74
}
77
75
78
- public static string GetBestMatchingRid ( RuntimeGraph runtimeGraph , string runtimeIdentifier ,
76
+ public static string ? GetBestMatchingRid ( RuntimeGraph runtimeGraph , string runtimeIdentifier ,
79
77
IEnumerable < string > availableRuntimeIdentifiers , out bool wasInGraph )
80
78
{
81
79
return GetBestMatchingRidWithExclusion ( runtimeGraph , runtimeIdentifier ,
82
80
runtimeIdentifiersToExclude : null ,
83
81
availableRuntimeIdentifiers , out wasInGraph ) ;
84
82
}
85
83
86
- public static string GetBestMatchingRidWithExclusion ( RuntimeGraph runtimeGraph , string runtimeIdentifier ,
87
- IEnumerable < string > runtimeIdentifiersToExclude ,
84
+ public static string ? GetBestMatchingRidWithExclusion ( RuntimeGraph runtimeGraph , string runtimeIdentifier ,
85
+ IEnumerable < string > ? runtimeIdentifiersToExclude ,
88
86
IEnumerable < string > availableRuntimeIdentifiers , out bool wasInGraph )
89
87
{
90
88
wasInGraph = runtimeGraph . Runtimes . ContainsKey ( runtimeIdentifier ) ;
91
89
92
- string bestMatch = null ;
90
+ string ? bestMatch = null ;
93
91
94
92
HashSet < string > availableRids = new ( availableRuntimeIdentifiers , StringComparer . Ordinal ) ;
95
- HashSet < string > excludedRids = runtimeIdentifiersToExclude switch { null => null , _ => new HashSet < string > ( runtimeIdentifiersToExclude , StringComparer . Ordinal ) } ;
93
+ HashSet < string > ? excludedRids = runtimeIdentifiersToExclude switch { null => null , _ => new HashSet < string > ( runtimeIdentifiersToExclude , StringComparer . Ordinal ) } ;
96
94
foreach ( var candidateRuntimeIdentifier in runtimeGraph . ExpandRuntime ( runtimeIdentifier ) )
97
95
{
98
96
if ( bestMatch == null && availableRids . Contains ( candidateRuntimeIdentifier ) )
0 commit comments