Skip to content

Commit 93eaf3a

Browse files
committed
cleanup
1 parent ffb363f commit 93eaf3a

3 files changed

Lines changed: 5 additions & 36 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#nullable enable
22
~NuGet.Commands.IRestoreTargetGraph.TargetAlias.get -> string
33
~NuGet.Commands.RestoreTargetGraph.TargetAlias.get -> string
4+
~NuGet.Commands.RestoreTargetGraph.TargetGraphNameWithAlias.get -> string

src/NuGet.Core/NuGet.Frameworks/FrameworkRuntimePair.cs

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,22 @@ namespace NuGet.Frameworks
1212
/// </remarks>
1313
public sealed class FrameworkRuntimePair : IEquatable<FrameworkRuntimePair>, IComparable<FrameworkRuntimePair>
1414
{
15-
public string TargetAlias { get; }
16-
1715
public NuGetFramework Framework { get; }
1816

1917
public string RuntimeIdentifier { get; }
2018

2119
public string Name { get; }
2220

23-
public FrameworkRuntimePair(string targetAlias, NuGetFramework framework, string? runtimeIdentifier)
21+
public FrameworkRuntimePair(NuGetFramework framework, string? runtimeIdentifier)
2422
{
25-
TargetAlias = targetAlias ?? throw new ArgumentNullException(nameof(targetAlias));
2623
Framework = framework ?? throw new ArgumentNullException(nameof(framework));
2724
RuntimeIdentifier = runtimeIdentifier ?? string.Empty;
28-
Name = GetTargetGraphName(targetAlias, runtimeIdentifier);
25+
Name = GetTargetGraphName(framework, runtimeIdentifier);
2926
}
3027

3128
public bool Equals(FrameworkRuntimePair? other)
3229
{
3330
return other != null &&
34-
string.Equals(TargetAlias, other.TargetAlias, StringComparison.Ordinal) &&
3531
Equals(Framework, other.Framework) &&
3632
string.Equals(RuntimeIdentifier, other.RuntimeIdentifier, StringComparison.Ordinal);
3733
}
@@ -43,15 +39,14 @@ public override bool Equals(object? obj)
4339

4440
public override int GetHashCode()
4541
{
46-
return HashCodeCombiner.GetHashCode(Framework, TargetAlias, RuntimeIdentifier);
42+
return HashCodeCombiner.GetHashCode(Framework, RuntimeIdentifier);
4743
}
4844

4945
public override string ToString()
5046
{
5147
return string.Format(
5248
CultureInfo.CurrentCulture,
53-
"{0}~{1}~{2}",
54-
TargetAlias,
49+
"{0}~{1}",
5550
Framework.GetShortFolderName(),
5651
RuntimeIdentifier);
5752
}
@@ -65,15 +60,9 @@ public int CompareTo(FrameworkRuntimePair? other)
6560
{
6661
return fxCompare;
6762
}
68-
fxCompare = string.Compare(TargetAlias, other.TargetAlias, StringComparison.Ordinal);
69-
if (fxCompare != 0)
70-
{
71-
return fxCompare;
72-
}
7363
return string.Compare(RuntimeIdentifier, other.RuntimeIdentifier, StringComparison.Ordinal);
7464
}
7565

76-
// TODO NK - What should this be.
7766
public static string GetTargetGraphName(NuGetFramework framework, string? runtimeIdentifier)
7867
{
7968
if (framework is null) throw new ArgumentNullException(nameof(framework));
@@ -91,23 +80,5 @@ public static string GetTargetGraphName(NuGetFramework framework, string? runtim
9180
runtimeIdentifier);
9281
}
9382
}
94-
95-
public static string GetTargetGraphName(string targetAlias, string? runtimeIdentifier)
96-
{
97-
if (targetAlias is null) throw new ArgumentNullException(nameof(targetAlias));
98-
99-
if (string.IsNullOrEmpty(runtimeIdentifier))
100-
{
101-
return targetAlias;
102-
}
103-
else
104-
{
105-
return string.Format(
106-
CultureInfo.InvariantCulture,
107-
"{0}/{1}",
108-
targetAlias,
109-
runtimeIdentifier);
110-
}
111-
}
11283
}
11384
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
#nullable enable
2-
NuGet.Frameworks.FrameworkRuntimePair.FrameworkRuntimePair(string! targetAlias, NuGet.Frameworks.NuGetFramework! framework, string? runtimeIdentifier) -> void
3-
NuGet.Frameworks.FrameworkRuntimePair.TargetAlias.get -> string!
4-
static NuGet.Frameworks.FrameworkRuntimePair.GetTargetGraphName(string! targetAlias, string? runtimeIdentifier) -> string!

0 commit comments

Comments
 (0)