StructReferenceEquals() public method

public StructReferenceEquals ( RubyStruct other ) : bool
other RubyStruct
return bool
コード例 #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));
        }
コード例 #2
0
ファイル: StructOps.cs プロジェクト: gaybro8777/ironruby
        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);
        }
コード例 #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);
        }
コード例 #4
0
ファイル: StructOps.cs プロジェクト: jschementi/iron
        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);
        }
コード例 #5
0
ファイル: StructOps.cs プロジェクト: jcteague/ironruby
        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;
        }