Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created February 7, 2017 15:28
Show Gist options
  • Save controlflow/a23e31d77508bd59a5153de448527066 to your computer and use it in GitHub Desktop.
Save controlflow/a23e31d77508bd59a5153de448527066 to your computer and use it in GitHub Desktop.
public IType GetEqualityParameterType(int parameterIndex)
{
if (myCachedEqualityParameterTypes[parameterIndex] == null)
myCachedEqualityParameterTypes[parameterIndex] = myEqualitySubstitution.Apply(myParameters[parameterIndex].Type);
return myCachedEqualityParameterTypes[parameterIndex];
}
public IType GetEqualityParameterType(int parameterIndex)
{
ref var parameterType = ref myCachedEqualityParameterTypes[parameterIndex];
if (parameterType == null)
parameterType = myEqualitySubstitution.Apply(myParameters[parameterIndex].Type);
return parameterType;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment