Skip to content

Commit 9e490b0

Browse files
emyllerclaude
andcommitted
Fix merge conflict remnants in type operations
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8e51d3e commit 9e490b0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

Flagsmith.Engine/Segment/Evaluator.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,12 @@ private static bool IntOperations(long contextValue, Condition condition)
358358
{
359359
switch (condition.Operator)
360360
{
361-
case Constants.Equal: return traitValue == InvariantConvert.ToInt32(condition.Value);
362-
case Constants.NotEqual: return traitValue != InvariantConvert.ToInt32(condition.Value);
363-
case Constants.GreaterThan: return traitValue > InvariantConvert.ToInt32(condition.Value);
364-
case Constants.GreaterThanInclusive: return traitValue >= InvariantConvert.ToInt32(condition.Value);
365-
case Constants.LessThan: return traitValue < InvariantConvert.ToInt32(condition.Value);
366-
case Constants.LessThanInclusive: return traitValue <= InvariantConvert.ToInt32(condition.Value);
367-
case Constants.In: return condition.Value.Split(',').Contains(traitValue.ToString());
361+
case Operator.Equal: return contextValue == InvariantConvert.ToInt32(condition.Value.String);
362+
case Operator.NotEqual: return contextValue != InvariantConvert.ToInt32(condition.Value.String);
363+
case Operator.GreaterThan: return contextValue > InvariantConvert.ToInt32(condition.Value.String);
364+
case Operator.GreaterThanInclusive: return contextValue >= InvariantConvert.ToInt32(condition.Value.String);
365+
case Operator.LessThan: return contextValue < InvariantConvert.ToInt32(condition.Value.String);
366+
case Operator.LessThanInclusive: return contextValue <= InvariantConvert.ToInt32(condition.Value.String);
368367
default: throw new ArgumentException("Invalid Operator");
369368
}
370369
}
@@ -373,13 +372,12 @@ private static bool DoubleOperations(double contextValue, Condition condition)
373372
{
374373
switch (condition.Operator)
375374
{
376-
case Constants.Equal: return traitValue == InvariantConvert.ToDouble(condition.Value);
377-
case Constants.NotEqual: return traitValue != InvariantConvert.ToDouble(condition.Value);
378-
case Constants.GreaterThan: return traitValue > InvariantConvert.ToDouble(condition.Value);
379-
case Constants.GreaterThanInclusive: return traitValue >= InvariantConvert.ToDouble(condition.Value);
380-
case Constants.LessThan: return traitValue < InvariantConvert.ToDouble(condition.Value);
381-
case Constants.LessThanInclusive: return traitValue <= InvariantConvert.ToDouble(condition.Value);
382-
case Constants.In: return false;
375+
case Operator.Equal: return contextValue == InvariantConvert.ToDouble(condition.Value.String);
376+
case Operator.NotEqual: return contextValue != InvariantConvert.ToDouble(condition.Value.String);
377+
case Operator.GreaterThan: return contextValue > InvariantConvert.ToDouble(condition.Value.String);
378+
case Operator.GreaterThanInclusive: return contextValue >= InvariantConvert.ToDouble(condition.Value.String);
379+
case Operator.LessThan: return contextValue < InvariantConvert.ToDouble(condition.Value.String);
380+
case Operator.LessThanInclusive: return contextValue <= InvariantConvert.ToDouble(condition.Value.String);
383381
default: throw new ArgumentException("Invalid Operator");
384382
}
385383
}

0 commit comments

Comments
 (0)