StructReferenceEquals() public method

public StructReferenceEquals ( RubyStruct other ) : bool
other RubyStruct
return bool
Example #1
0
        public static bool Equals(BinaryOpStorage /*!*/ equals, RubyStruct /*!*/ self, object obj)
        {
            var other = obj as RubyStruct;

            if (!self.StructReferenceEquals(other))
            {
                return(false);
            }
            Debug.Assert(self.ItemCount == other.ItemCount);

            return(IListOps.Equals(equals, self.Values, other.Values));
        }
Example #2
0
        public static bool Equals(RubyStruct /*!*/ self, object obj)
        {
            var other = obj as RubyStruct;

            if (!self.StructReferenceEquals(other))
            {
                return(false);
            }

            Debug.Assert(self.ItemCount == other.ItemCount);
            for (int i = 0; i < self.Values.Length; i++)
            {
                if (!RubySites.Equal(self.Class.Context, self.Values[i], other.Values[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Example #3
0
        public static bool Equals(BinaryOpStorage /*!*/ equals, RubyStruct /*!*/ self, object obj)
        {
            var other = obj as RubyStruct;

            if (!self.StructReferenceEquals(other))
            {
                return(false);
            }
            Debug.Assert(self.ItemCount == other.ItemCount);

            if (self.Values.Length > 0)
            {
                var site = equals.GetCallSite("==");
                for (int i = 0; i < self.Values.Length; i++)
                {
                    if (RubyOps.IsFalse(site.Target(site, self.Values[i], other.Values[i])))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Example #4
0
        public static bool Equals(BinaryOpStorage/*!*/ equals, RubyStruct/*!*/ self, object obj) {
            var other = obj as RubyStruct;
            if (!self.StructReferenceEquals(other)) {
                return false;
            }
            Debug.Assert(self.ItemCount == other.ItemCount);

            return IListOps.Equals(equals, self.Values, other.Values);
        }
Example #5
0
        public static bool Equals(BinaryOpStorage/*!*/ equals, RubyStruct/*!*/ self, object obj) {
            var other = obj as RubyStruct;
            if (!self.StructReferenceEquals(other)) {
                return false;
            }
            Debug.Assert(self.ItemCount == other.ItemCount);

            if (self.Values.Length > 0) {
                var site = equals.GetCallSite("==");
                for (int i = 0; i < self.Values.Length; i++) {
                    if (RubyOps.IsFalse(site.Target(site, self.Values[i], other.Values[i]))) {
                        return false;
                    }
                }
            }

            return true;
        }