Example #1
0
        internal void AssertEquivalentTo(SymbolTreeInfo other)
        {
            Debug.Assert(_version.Equals(other._version));
            Debug.Assert(_concatenatedNames == other._concatenatedNames);
            Debug.Assert(_nodes.Length == other._nodes.Length);

            for (int i = 0, n = _nodes.Length; i < n; i++)
            {
                _nodes[i].AssertEquivalentTo(other._nodes[i]);
            }

            Debug.Assert(_inheritanceMap.Keys.Count == other._inheritanceMap.Keys.Count);
            var orderedKeys1 = this._inheritanceMap.Keys.Order().ToList();
            var orderedKeys2 = other._inheritanceMap.Keys.Order().ToList();

            for (int i = 0; i < orderedKeys1.Count; i++)
            {
                var values1 = this._inheritanceMap[i];
                var values2 = other._inheritanceMap[i];

                Debug.Assert(values1.Length == values2.Length);
                for (int j = 0; j < values1.Length; j++)
                {
                    Debug.Assert(values1[j] == values2[j]);
                }
            }
        }
Example #2
0
        internal bool IsEquivalent(SymbolTreeInfo other)
        {
            if (!_version.Equals(other._version) || _nodes.Count != other._nodes.Count)
            {
                return(false);
            }

            for (int i = 0, n = _nodes.Count; i < n; i++)
            {
                if (!_nodes[i].IsEquivalent(other._nodes[i]))
                {
                    return(false);
                }
            }

            return(true);
        }