Browse Source

Remove operator == from AstNodeCollection.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
877ebf8bdb
  1. 21
      ICSharpCode.NRefactory.VB/Ast/AstNodeCollection.cs
  2. 21
      ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs

21
ICSharpCode.NRefactory.VB/Ast/AstNodeCollection.cs

@ -133,28 +133,17 @@ namespace ICSharpCode.NRefactory.VB @@ -133,28 +133,17 @@ namespace ICSharpCode.NRefactory.VB
}
#region Equals and GetHashCode implementation
public override bool Equals(object obj)
{
if (obj is AstNodeCollection<T>) {
return ((AstNodeCollection<T>)obj) == this;
} else {
return false;
}
}
public override int GetHashCode()
{
return node.GetHashCode() ^ role.GetHashCode();
}
public static bool operator ==(AstNodeCollection<T> left, AstNodeCollection<T> right)
{
return left.role == right.role && left.node == right.node;
}
public static bool operator !=(AstNodeCollection<T> left, AstNodeCollection<T> right)
public override bool Equals(object obj)
{
return !(left.role == right.role && left.node == right.node);
AstNodeCollection<T> other = obj as AstNodeCollection<T>;
if (other == null)
return false;
return this.node == other.node && this.role == other.role;
}
#endregion

21
ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs

@ -132,28 +132,17 @@ namespace ICSharpCode.NRefactory.CSharp @@ -132,28 +132,17 @@ namespace ICSharpCode.NRefactory.CSharp
}
#region Equals and GetHashCode implementation
public override bool Equals(object obj)
{
if (obj is AstNodeCollection<T>) {
return ((AstNodeCollection<T>)obj) == this;
} else {
return false;
}
}
public override int GetHashCode()
{
return node.GetHashCode() ^ role.GetHashCode();
}
public static bool operator ==(AstNodeCollection<T> left, AstNodeCollection<T> right)
{
return left.role == right.role && left.node == right.node;
}
public static bool operator !=(AstNodeCollection<T> left, AstNodeCollection<T> right)
public override bool Equals(object obj)
{
return !(left.role == right.role && left.node == right.node);
AstNodeCollection<T> other = obj as AstNodeCollection<T>;
if (other == null)
return false;
return this.node == other.node && this.role == other.role;
}
#endregion

Loading…
Cancel
Save