[#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
749000a090
commit
9bb7b5eff8
62 changed files with 2742 additions and 963 deletions
|
@ -36,13 +36,19 @@ public struct FrostFsChainTarget(FrostFsTargetType type, string name) : IEquatab
|
|||
|
||||
public override readonly bool Equals(object obj)
|
||||
{
|
||||
var target = (FrostFsChainTarget)obj;
|
||||
return Equals(target);
|
||||
if (obj == null || obj is not FrostFsChainTarget)
|
||||
return false;
|
||||
|
||||
return Equals((FrostFsChainTarget)obj);
|
||||
}
|
||||
public readonly bool Equals(FrostFsChainTarget other)
|
||||
{
|
||||
return Type == other.Type && Name.Equals(other.Name, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return $"{Name}{Type}".GetHashCode();
|
||||
return Name.GetHashCode() ^ (int)Type;
|
||||
}
|
||||
|
||||
public static bool operator ==(FrostFsChainTarget left, FrostFsChainTarget right)
|
||||
|
@ -54,9 +60,4 @@ public struct FrostFsChainTarget(FrostFsTargetType type, string name) : IEquatab
|
|||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
public readonly bool Equals(FrostFsChainTarget other)
|
||||
{
|
||||
return Type == other.Type && Name.Equals(other.Name, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue