Skip to content

Commit

Permalink
Cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkcod committed May 19, 2015
1 parent 7daf3ca commit 3fe3c24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/Reflection/MemberInfoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static class MemberInfoExtensions
{
delegate object Getter(object source);

static Dictionary<MemberInfo, Getter> getterCache = new Dictionary<MemberInfo, Getter>();
static readonly Dictionary<MemberInfo, Getter> getterCache = new Dictionary<MemberInfo, Getter>();

public static object GetValue(this MemberInfo self, object target) {
switch(self.MemberType) {
Expand All @@ -23,13 +23,13 @@ public static object GetValue(this MemberInfo self, object target) {
}

static object ReadField(FieldInfo field, object target) {
var getter = GetGetter(field, name => field.CreateGetter(name));
var getter = GetGetter(field, field.CreateGetter);
return getter(target);
}

static object InvokeGet(MethodInfo getMethod, object target) {
try {
var getter = GetGetter(getMethod, name => getMethod.CreateGetter(name));
var getter = GetGetter(getMethod, getMethod.CreateGetter);
return getter(target);
} catch(Exception e) {
throw new TargetInvocationException(e);
Expand Down
2 changes: 1 addition & 1 deletion Specs/Cone.Specs/ConeMethodClassifierSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Mock<IMultiSink> Classify(MethodInfo method) {
return sink;
}

MethodInfo Method(Expression<Action<SampleFixture>> x) {
static MethodInfo Method(Expression<Action<SampleFixture>> x) {
return ((MethodCallExpression)x.Body).Method;
}

Expand Down

0 comments on commit 3fe3c24

Please sign in to comment.