Antlr4.Runtime.Sharpen.BitSet.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj)
        {
            BitSet other = obj as BitSet;
            if (other == null)
                return false;

            if (IsEmpty())
                return other.IsEmpty();

            int minLength = Math.Min(_data.Length, other._data.Length);
            for (int i = 0; i < minLength; i++)
            {
                if (_data[i] != other._data[i])
                    return false;
            }

            for (int i = minLength; i < _data.Length; i++)
            {
                if (_data[i] != 0)
                    return false;
            }

            for (int i = minLength; i < other._data.Length; i++)
            {
                if (other._data[i] != 0)
                    return false;
            }

            return true;
        }