Inference/src/Semantic/SSAAlgorithm/SSAHelper.cs
/// <summary>
/// Calculates the intersection of two sets.
/// Used to know which references are used in the else branch body, but not in the if branch body
/// </summary>
/// <param name="setA">One set</param>
/// <param name="setB">Another set</param>
/// <returns>The intersection set</returns>
Calculates the intersection of two sets.
Used to know which references are used in the else branch body, but not in the if branch body
Calculates the intersection of two sets . Used to know which references are used in the else branch body but not in the if branch body
public static IDictionary<SingleIdentifierExpression, TypeExpression> Intersection(IDictionary<SingleIdentifierExpression, TypeExpression> setA, IList<SingleIdentifierExpression> setB) {
            IDictionary<SingleIdentifierExpression, TypeExpression> typeExpressionIntersectionSet = new Dictionary<SingleIdentifierExpression, TypeExpression>();
            foreach (KeyValuePair<SingleIdentifierExpression, TypeExpression> pair in setA)
                if (setB.Contains(pair.Key))
                    typeExpressionIntersectionSet[pair.Key] = pair.Value;
            return typeExpressionIntersectionSet;
        }
public static IDictionary < SingleIdentifierExpression , TypeExpression > Intersection ( IDictionary < SingleIdentifierExpression , TypeExpression > setA , IList < SingleIdentifierExpression > setB ) { IDictionary < SingleIdentifierExpression , TypeExpression > typeExpressionIntersectionSet = new Dictionary < SingleIdentifierExpression , TypeExpression > ( ) ; foreach ( KeyValuePair < SingleIdentifierExpression , TypeExpression > pair in setA ) if ( setB . Contains ( pair . Key ) ) typeExpressionIntersectionSet [ pair . Key ] = pair . Value ; return typeExpressionIntersectionSet ; }
Calculates the intersection of two sets.
Calculates the intersection of two sets .
The intersection set
The intersection set
setA
IDictionary<SingleIdentifierExpression, TypeExpression>
None
setB
IList<SingleIdentifierExpression>
None