private bool DependsTransitivelyOn(int iParam, int jParam)
{
Debug.Assert(_ppDependencies != null);
Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.size);
Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.size);
// Can we find Xk such that Xi depends on Xk and Xk depends on Xj?
// If so, then Xi depends indirectly on Xj. (Note that there is
// a minor optimization here -- the spec comment above notes that
// we want Xi to depend DIRECTLY on Xk, and Xk to depend directly
// or indirectly on Xj. But if we already know that Xi depends
// directly OR indirectly on Xk and Xk depends on Xj, then that's
// good enough.)
for (int kParam = 0; kParam < _pMethodTypeParameters.size; ++kParam)
{
if (0 != ((_ppDependencies[iParam][kParam]) & Dependency.DependsMask) &&
0 != ((_ppDependencies[kParam][jParam]) & Dependency.DependsMask))
{
return true;
}
}
return false;
}