Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Simplify logic in ExpressionMatcher.Matches
Browse files Browse the repository at this point in the history
This fixes devlooped#237.
  • Loading branch information
stakx committed May 31, 2017
1 parent 0094c40 commit 18cfbc6
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 18cfbc6

Please sign in to comment.