Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Feb 8, 2024
1 parent a63cf49 commit decab11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ConfigCatClient/Evaluation/EvaluateLogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ UserComparator.SensitiveTextEquals or

public static IndentedTextBuilder AppendPrerequisiteFlagCondition(this IndentedTextBuilder builder, PrerequisiteFlagCondition condition)
{
var prerequisiteFlagKey = condition.PrerequisiteFlagKey;
var prerequisiteFlagKey = condition.PrerequisiteFlagKey ?? InvalidReferencePlaceholder;
var comparator = condition.Comparator;
var comparisonValue = condition.ComparisonValue.GetValue(throwIfInvalid: false);

Expand Down
8 changes: 3 additions & 5 deletions src/ConfigCatClient/Evaluation/RolloutEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private bool EvaluateConditions<TCondition>(TCondition[] conditions, TargetingRu
break;

case PrerequisiteFlagCondition prerequisiteFlagCondition:
conditionResult = EvaluatePrerequisiteFlagCondition(prerequisiteFlagCondition, ref context, out error);
conditionResult = EvaluatePrerequisiteFlagCondition(prerequisiteFlagCondition, ref context);
newLineBeforeThen = true;
break;

Expand Down Expand Up @@ -708,10 +708,8 @@ private static bool EvaluateSensitiveArrayContainsAnyOf(string[] array, string[]
return negate;
}

private bool EvaluatePrerequisiteFlagCondition(PrerequisiteFlagCondition condition, ref EvaluateContext context, out string? error)
private bool EvaluatePrerequisiteFlagCondition(PrerequisiteFlagCondition condition, ref EvaluateContext context)
{
error = null;

var logBuilder = context.LogBuilder;
logBuilder?.AppendPrerequisiteFlagCondition(condition);

Expand Down Expand Up @@ -759,7 +757,7 @@ private bool EvaluatePrerequisiteFlagCondition(PrerequisiteFlagCondition conditi
};

logBuilder?
.NewLine().Append($"Prerequisite flag evaluation result: '{prerequisiteFlagValue ?? EvaluateLogHelper.InvalidValuePlaceholder}'.")
.NewLine().Append($"Prerequisite flag evaluation result: '{prerequisiteFlagValue}'.")
.NewLine("Condition (")
.AppendPrerequisiteFlagCondition(condition)
.Append(") evaluates to ").AppendEvaluationResult(result).Append(".")
Expand Down

0 comments on commit decab11

Please sign in to comment.