Skip to content

Commit

Permalink
Simplify logic in ExpressionMatcher.Matches
Browse files Browse the repository at this point in the history
  • Loading branch information
stakx committed Jun 5, 2017
1 parent 2bf7e81 commit f8e6187
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Source/Matchers/ExpressionMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,8 @@ void IMatcher.Initialize(Expression matcherExpression)

public bool Matches(object value)
{
var valueExpression = value as Expression;
if (value == null)
{
return false;
}

return ExpressionComparer.Default.Equals(this.expression, valueExpression);
return value is Expression valueExpression
&& ExpressionComparer.Default.Equals(this.expression, valueExpression);
}
}
}

0 comments on commit f8e6187

Please sign in to comment.