Example #1
0
        int IStructuralEquatable.GetHashCode(IEqualityComparer /*!*/ comparer)
        {
            if (CompareUtil.Check(this))
            {
                return(0);
            }

            int res;

            CompareUtil.Push(this);
            try {
                res = ((IStructuralEquatable) new FrozenSetCollection(_items)).GetHashCode(comparer);
            } finally {
                CompareUtil.Pop(this);
            }

            return(res);
        }
Example #2
0
        int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
        {
            if (CompareUtil.Check(this))
            {
                return(0);
            }

            int  res;
            ISet pairs = new FrozenSetCollection();

            foreach (KeyValuePair <object, object> kvp in _storage.GetItems())
            {
                pairs.PrivAdd(PythonTuple.MakeTuple(kvp.Key, kvp.Value));
            }

            CompareUtil.Push(this);
            try {
                res = pairs.GetHashCode(comparer);
            } finally {
                CompareUtil.Pop(this);
            }

            return(res);
        }