File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -431,11 +431,12 @@ class DefaultDecisionService: OPTDecisionService {
431
431
logger. i ( info)
432
432
433
433
// bucket user into holdout variation
434
- let decisionResponse = bucketer. bucketToVariation ( experiment: holdout, bucketingId: bucketingId)
435
-
436
- reasons. merge ( decisionResponse. reasons)
434
+ let decisionResponse = ( bucketer as? DefaultBucketer ) ? . bucketToVariation ( experiment: holdout, bucketingId: bucketingId)
435
+ if let reason = decisionResponse? . reasons {
436
+ reasons. merge ( reason)
437
+ }
437
438
438
- bucketedVariation = decisionResponse. result
439
+ bucketedVariation = decisionResponse? . result
439
440
440
441
if let variation = bucketedVariation {
441
442
let info = LogMessage . userBucketedIntoVariationInHoldout ( userId, holdout. key, variation. key)
Original file line number Diff line number Diff line change @@ -37,15 +37,6 @@ protocol OPTBucketer {
37
37
experiment: Experiment ,
38
38
bucketingId: String ) -> DecisionResponse < Variation >
39
39
40
- /**
41
- Bucket a bucketingId into an experiment.
42
- - Parameter experiment: The rule in which to bucket the bucketingId.
43
- - Parameter bucketingId: The ID to bucket. This must be a non-null, non-empty string.
44
- - Returns: The variation the bucketingId was bucketed into.
45
- */
46
- func bucketToVariation( experiment: ExperimentCore ,
47
- bucketingId: String ) -> DecisionResponse < Variation >
48
-
49
40
/**
50
41
Hash the bucketing ID and map it to the range [0, 10000).
51
42
- Parameter bucketingId: The ID for which to generate the hash and bucket values.
You can’t perform that action at this time.
0 commit comments