-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: refactor Variation methods for correctness & clarity #203
Changes from all commits
607024a
f49d534
53c8c54
d14350b
f1ebea7
aa85920
709c995
5406b59
e45741b
298c6d8
d1976df
dbb541d
0b3f00a
ac96b10
2d4e5b8
0829bca
e2d01df
37e604a
22911a2
2ddf672
a41423f
d5ce5af
0145069
57f5f9c
e9c068d
e578ad1
9b9a984
796ff70
3713595
144d705
059b21a
43f27cb
07663f7
daef5cb
47ad8bb
ca9a74e
d5cd0fa
219d7a9
33944c7
41a9e4c
14e0c14
1a3a405
d8754a5
405693f
1cf9666
4ce9dc9
63e3ad1
275b238
2e49214
5b7e08e
a6589e7
6b1f647
15f362e
b1d1398
8b0fbac
73b8900
1cf17bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
Flag::Weight weight_) | ||
: WeightedVariation(variation_, weight_, false) {} | ||
|
||
Flag::Rollout::WeightedVariation::WeightedVariation(Flag::Variation variation_, | ||
Check warning on line 9 in libs/internal/src/data_model/flag.cpp GitHub Actions / cpp-linter/libs/internal/src/data_model/flag.cpp:9:53 [bugprone-easily-swappable-parameters]
|
||
Flag::Weight weight_, | ||
bool untracked_) | ||
: variation(variation_), weight(weight_), untracked(untracked_) {} | ||
|
@@ -26,4 +26,26 @@ | |
bucketBy("key"), | ||
contextKind("user") {} | ||
|
||
bool Flag::IsExperimentationEnabled( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just moving this from where the |
||
std::optional<EvaluationReason> const& reason) const { | ||
if (!reason) { | ||
return false; | ||
} | ||
if (reason->InExperiment()) { | ||
return true; | ||
} | ||
switch (reason->Kind()) { | ||
case EvaluationReason::Kind::kFallthrough: | ||
return this->trackEventsFallthrough; | ||
case EvaluationReason::Kind::kRuleMatch: | ||
if (!reason->RuleIndex() || | ||
reason->RuleIndex() >= this->rules.size()) { | ||
return false; | ||
} | ||
return this->rules.at(*reason->RuleIndex()).trackEvents; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
} // namespace launchdarkly::data_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo! Just streaming issues left.