/** * An intersection of a type predicate and a predicate with a known type is * equivalent to the known type predicate. */ private void RemoveRedundantTypeIntersections(ArrayList newPredicateList, ref bool optimized) { int knownTypeId = -1; for (int i = 0; i < newPredicateList.Count; i++) { ResourceListPredicate predicate = (ResourceListPredicate)newPredicateList [i]; if (!(predicate.HasAnyTypePredicate())) { int predKnownTypeId = predicate.GetKnownType(); if (knownTypeId == -1) { knownTypeId = predKnownTypeId; } else if (predKnownTypeId != knownTypeId) { return; } } } if (knownTypeId != -1) { for (int i = newPredicateList.Count - 1; i >= 0; i--) { if (((ResourceListPredicate)newPredicateList [i]).HasTypePredicate(knownTypeId)) { newPredicateList.RemoveAt(i); optimized = true; } } } }
internal override int GetKnownType() { return _lhs.GetKnownType(); }