Пример #1
0
 public override bool Equals(StackItem other)
 {
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (other is Boolean b)
     {
         return(value == b.value);
     }
     byte[] bytes_other;
     try
     {
         bytes_other = other.GetByteArray();
     }
     catch (NotSupportedException)
     {
         return(false);
     }
     return(GetByteArray().SequenceEqual(bytes_other));
 }
Пример #2
0
 public override bool Equals(StackItem other)
 {
     TR.Enter();
     if (ReferenceEquals(this, other))
     {
         return(TR.Exit(true));
     }
     if (ReferenceEquals(null, other))
     {
         return(TR.Exit(false));
     }
     if (other is Integer i)
     {
         return(TR.Exit(value == i.value));
     }
     byte[] bytes_other;
     try
     {
         bytes_other = other.GetByteArray();
     }
     catch (NotSupportedException)
     {
         return(TR.Exit(false));
     }
     return(TR.Exit(GetByteArray().SequenceEqual(bytes_other)));
 }
Пример #3
0
 public override bool Equals(StackItem other)
 {
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (other is null)
     {
         return(false);
     }
     if (other is Integer i)
     {
         return(value == i.value);
     }
     byte[] bytes_other;
     try
     {
         bytes_other = other.GetByteArray();
     }
     catch (NotSupportedException)
     {
         return(false);
     }
     return(Unsafe.MemoryEquals(GetByteArray(), bytes_other));
 }
Пример #4
0
        public override bool Equals(StackItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (other is null)
            {
                return(false);
            }
            if (other is Boolean b)
            {
                return(value == b.value);
            }
            ReadOnlyMemory <byte> bytes_other;

            try
            {
                bytes_other = other.GetByteArray();
            }
            catch (NotSupportedException)
            {
                return(false);
            }
            return(Unsafe.MemoryEquals(GetByteArray().Span, bytes_other.Span));
        }
Пример #5
0
 public override bool Equals(StackItem other)
 {
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     return(value.SequenceEqual(other.GetByteArray()));
 }
Пример #6
0
        public override bool Equals(StackItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            Integer i = other as Integer;

            if (i == null)
            {
                return(GetByteArray().SequenceEqual(other.GetByteArray()));
            }
            else
            {
                return(value == i.value);
            }
        }
Пример #7
0
        public override bool Equals(StackItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            Boolean b = other as Boolean;

            if (b == null)
            {
                return(GetByteArray().SequenceEqual(other.GetByteArray()));
            }
            else
            {
                return(value == b.value);
            }
        }