Skip to content

Commit 49ef7a3

Browse files
committed
add option for removing feature from evaluation
1 parent da5743a commit 49ef7a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/CommonMain/Evaluators/FeatureEvaluator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class FeatureEvaluator {
3333
context.stackContext.evaluatedFeatures.insert(featureKey)
3434
context.stackContext.id = featureKey
3535

36+
defer {
37+
context.stackContext.evaluatedFeatures.remove(featureKey)
38+
}
39+
3640
if context.userContext.forcedFeatureValues?.dictionaryValue[featureKey] != nil {
3741
let value = context.userContext.forcedFeatureValues?[featureKey] ?? "nil"
3842
logger.info("Global override for forced feature with key: \(featureKey) and value \(value)")

0 commit comments

Comments
 (0)