Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether this container contains the same definitions as the given one.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns>True whether this container contains the same definitions as the given one.</returns>
        internal bool DataEquals(DeclarationContainer <T> other)
        {
            HashSet <QualifiedName> names = new HashSet <QualifiedName>();

            HashSetTools.AddAll(names, this.declarations.Keys);
            HashSetTools.AddAll(names, other.declarations.Keys);

            foreach (var name in names)
            {
                HashSet <T> otherDecl, thisDecl;
                if (!other.declarations.TryGetValue(name, out otherDecl))
                {
                    return(false);
                }

                if (!this.declarations.TryGetValue(name, out thisDecl))
                {
                    return(false);
                }

                if (!HashSetTools.EqualsSet(thisDecl, otherDecl))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        internal bool DataEquals(MemoryAlias other)
        {
            if (other == null)
            {
                return(this.MayAliasses.Count == 0 && this.MustAliasses.Count == 0);
            }

            if (this.MayAliasses.Count != other.MayAliasses.Count ||
                this.MustAliasses.Count != other.MustAliasses.Count)
            {
                return(false);
            }

            return(HashSetTools.EqualsSet(this.MustAliasses, other.MustAliasses) ||
                   HashSetTools.EqualsSet(this.MayAliasses, other.MayAliasses));
        }