mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Use file scoped namespace declarations
This commit is contained in:

committed by
Phil Scott

parent
1dbaf50935
commit
ec1188b837
@ -1,32 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Spectre.Console.Cli
|
||||
namespace Spectre.Console.Cli;
|
||||
|
||||
internal static class CommandParameterComparer
|
||||
{
|
||||
internal static class CommandParameterComparer
|
||||
public static readonly ByBackingPropertyComparer ByBackingProperty = new ByBackingPropertyComparer();
|
||||
|
||||
public sealed class ByBackingPropertyComparer : IEqualityComparer<CommandParameter?>
|
||||
{
|
||||
public static readonly ByBackingPropertyComparer ByBackingProperty = new ByBackingPropertyComparer();
|
||||
|
||||
public sealed class ByBackingPropertyComparer : IEqualityComparer<CommandParameter?>
|
||||
public bool Equals(CommandParameter? x, CommandParameter? y)
|
||||
{
|
||||
public bool Equals(CommandParameter? x, CommandParameter? y)
|
||||
if (x is null || y is null)
|
||||
{
|
||||
if (x is null || y is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(x, y))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return x.Property.MetadataToken == y.Property.MetadataToken;
|
||||
return false;
|
||||
}
|
||||
|
||||
public int GetHashCode(CommandParameter? obj)
|
||||
if (ReferenceEquals(x, y))
|
||||
{
|
||||
return obj?.Property?.MetadataToken.GetHashCode() ?? 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return x.Property.MetadataToken == y.Property.MetadataToken;
|
||||
}
|
||||
|
||||
public int GetHashCode(CommandParameter? obj)
|
||||
{
|
||||
return obj?.Property?.MetadataToken.GetHashCode() ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user