Skip to content

Commit

Permalink
Merge pull request #93 from bijington/issue-91-revert-string-comparer…
Browse files Browse the repository at this point in the history
…-dictionary

Reverted to only wrapping the variables if we internally expect a
  • Loading branch information
bijington authored Jan 11, 2021
2 parents 50783eb + e2e4f3f commit 88903e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Expressive/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class Context
? StringComparison.OrdinalIgnoreCase
: StringComparison.Ordinal;

private bool IsCaseInsensitiveParsingEnabled =>
internal bool IsCaseInsensitiveParsingEnabled =>
#pragma warning disable 618 // As it is our own warning this is safe enough until we actually get rid
Options.HasFlag(ExpressiveOptions.IgnoreCase) || Options.HasFlag(ExpressiveOptions.IgnoreCaseForParsing);
#pragma warning restore 618
Expand Down
3 changes: 2 additions & 1 deletion Source/Expressive/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public object Evaluate(IDictionary<string, object> variables = null)
{
this.CompileExpression();

if (variables != null)
if (variables != null &&
this.context.IsCaseInsensitiveParsingEnabled)
{
variables = new Dictionary<string, object>(variables, this.context.ParsingStringComparer);
}
Expand Down

0 comments on commit 88903e2

Please sign in to comment.