@@ -250,7 +250,7 @@ private static FlagResult<FeatureMetadataT> GetFlagResult<_, FeatureMetadataT>(E
250250 Enabled = featureContext . Enabled ,
251251 Value = variant . Value ,
252252 Metadata = featureContext . Metadata ,
253- Reason = $ "SPLIT; weight={ weight } ",
253+ Reason = FormattableString . Invariant ( $ "SPLIT; weight={ weight } ") ,
254254 } ;
255255 break ;
256256 }
@@ -373,7 +373,7 @@ static bool longOperations(long traitValue, SegmentConditionModel condition)
373373 long conditionValue ;
374374 try
375375 {
376- conditionValue = Convert . ToInt64 ( condition . Value ) ;
376+ conditionValue = InvariantConvert . ToInt64 ( condition . Value ) ;
377377 }
378378 catch ( FormatException )
379379 {
@@ -396,12 +396,12 @@ static bool intOperations(long traitValue, SegmentConditionModel condition)
396396 {
397397 switch ( condition . Operator )
398398 {
399- case Constants . Equal : return traitValue == Convert . ToInt32 ( condition . Value ) ;
400- case Constants . NotEqual : return traitValue != Convert . ToInt32 ( condition . Value ) ;
401- case Constants . GreaterThan : return traitValue > Convert . ToInt32 ( condition . Value ) ;
402- case Constants . GreaterThanInclusive : return traitValue >= Convert . ToInt32 ( condition . Value ) ;
403- case Constants . LessThan : return traitValue < Convert . ToInt32 ( condition . Value ) ;
404- case Constants . LessThanInclusive : return traitValue <= Convert . ToInt32 ( condition . Value ) ;
399+ case Constants . Equal : return traitValue == InvariantConvert . ToInt32 ( condition . Value ) ;
400+ case Constants . NotEqual : return traitValue != InvariantConvert . ToInt32 ( condition . Value ) ;
401+ case Constants . GreaterThan : return traitValue > InvariantConvert . ToInt32 ( condition . Value ) ;
402+ case Constants . GreaterThanInclusive : return traitValue >= InvariantConvert . ToInt32 ( condition . Value ) ;
403+ case Constants . LessThan : return traitValue < InvariantConvert . ToInt32 ( condition . Value ) ;
404+ case Constants . LessThanInclusive : return traitValue <= InvariantConvert . ToInt32 ( condition . Value ) ;
405405 case Constants . In : return condition . Value . Split ( ',' ) . Contains ( traitValue . ToString ( ) ) ;
406406 default : throw new ArgumentException ( "Invalid Operator" ) ;
407407 }
@@ -411,12 +411,12 @@ static bool doubleOperations(double traitValue, SegmentConditionModel condition)
411411 {
412412 switch ( condition . Operator )
413413 {
414- case Constants . Equal : return traitValue == Convert . ToDouble ( condition . Value ) ;
415- case Constants . NotEqual : return traitValue != Convert . ToDouble ( condition . Value ) ;
416- case Constants . GreaterThan : return traitValue > Convert . ToDouble ( condition . Value ) ;
417- case Constants . GreaterThanInclusive : return traitValue >= Convert . ToDouble ( condition . Value ) ;
418- case Constants . LessThan : return traitValue < Convert . ToDouble ( condition . Value ) ;
419- case Constants . LessThanInclusive : return traitValue <= Convert . ToDouble ( condition . Value ) ;
414+ case Constants . Equal : return traitValue == InvariantConvert . ToDouble ( condition . Value ) ;
415+ case Constants . NotEqual : return traitValue != InvariantConvert . ToDouble ( condition . Value ) ;
416+ case Constants . GreaterThan : return traitValue > InvariantConvert . ToDouble ( condition . Value ) ;
417+ case Constants . GreaterThanInclusive : return traitValue >= InvariantConvert . ToDouble ( condition . Value ) ;
418+ case Constants . LessThan : return traitValue < InvariantConvert . ToDouble ( condition . Value ) ;
419+ case Constants . LessThanInclusive : return traitValue <= InvariantConvert . ToDouble ( condition . Value ) ;
420420 case Constants . In : return false ;
421421 default : throw new ArgumentException ( "Invalid Operator" ) ;
422422 }
0 commit comments