コード例 #1
0
 private bool ResolveEquals(object left, object right, LiteralType type)
 {
     if (type == LiteralType.Binary)
     {
         return(LiteralUtil.ByteArrayEquals((byte[])left, (byte[])right));
     }
     else
     {
         return(Equals(left, right));
     }
 }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            var other = obj as LiteralToken;

            if (other == null)
            {
                return(false);
            }

            var bytes      = Value as byte[];
            var otherBytes = other.Value as byte[];

            if (bytes != null && otherBytes != null)
            {
                return(LiteralUtil.ByteArrayEquals(bytes, otherBytes));
            }

            return(Equals(Value, other.Value));
        }