This code only runs for methods with dependent method types, so performance isn't so critical.