Skip to content

Commit dfe1367

Browse files
refactor: less movement of code as the ref implementation
1 parent c9047a0 commit dfe1367

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

OptimizelySDK/Bucketing/DecisionService.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public bool DecisionBatchInProgress
5656
{
5757
SaveToUserProfileService();
5858
}
59+
5960
_decisionBatchInProgress = value;
6061
}
6162
}
@@ -168,6 +169,13 @@ OptimizelyDecideOption[] options
168169
UserProfileUtil.IsValidUserProfileMap(userProfileMap))
169170
{
170171
_userProfile = UserProfileUtil.ConvertMapToUserProfile(userProfileMap);
172+
decisionVariationResult =
173+
GetStoredVariation(experiment, _userProfile, config);
174+
reasons += decisionVariationResult.DecisionReasons;
175+
if (decisionVariationResult.ResultObject != null)
176+
{
177+
return decisionVariationResult.SetReasons(reasons);
178+
}
171179
}
172180
else if (userProfileMap == null)
173181
{
@@ -181,17 +189,6 @@ OptimizelyDecideOption[] options
181189
reasons.AddInfo("The UserProfileService returned an invalid map."));
182190
}
183191
}
184-
185-
if (_userProfile != null)
186-
{
187-
decisionVariationResult =
188-
GetStoredVariation(experiment, _userProfile, config);
189-
reasons += decisionVariationResult.DecisionReasons;
190-
if (decisionVariationResult.ResultObject != null)
191-
{
192-
return decisionVariationResult.SetReasons(reasons);
193-
}
194-
}
195192
}
196193
catch (Exception exception)
197194
{

0 commit comments

Comments
 (0)