/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is
/// equal to the current <see cref="CyrusBuilt.MonoPi.BitSet"/>.
/// </summary>
/// <param name="obj">
/// The <see cref="System.Object"/> to compare with the current <see cref="CyrusBuilt.MonoPi.BitSet"/>.
/// </param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="CyrusBuilt.MonoPi.BitSet"/>; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
if (obj == null)
{
return(false);
}
BitSet bs = obj as BitSet;
if (bs == null)
{
return(false);
}
this.CheckInvariants();
bs.CheckInvariants();
if (this._wordsInUse != bs._wordsInUse)
{
return(false);
}
Boolean result = true;
for (Int32 i = 0; i < this._wordsInUse; i++)
{
if (this._bits[i] != bs._bits[i])
{
result = false;
break;
}
}
return(result);
}