Skip to content

Commit fd681b1

Browse files
only trim user profile service if the number of experiments in the map is over 100 (#358)
1 parent 73d2b6b commit fd681b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

OptimizelySDKUserProfileService/OptimizelySDKUserProfileService/OPTLYUserProfileService.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ - (void)removeInvalidExperimentsForAllUsers:(NSArray<NSString *> *)validExperime
165165
NSMutableDictionary *userProfileDict = [userProfileService[key] mutableCopy];
166166
NSDictionary * bucketMap = userProfileDict[@"experiment_bucket_map"];
167167
NSMutableDictionary *newBucketMap = [bucketMap mutableCopy];
168+
if (bucketMap.count < 100) {
169+
continue;
170+
}
168171
for (NSString *exId in bucketMap.allKeys) {
169172
if (![validExperimentIds containsObject:exId]) {
170173
[newBucketMap removeObjectForKey:exId];

0 commit comments

Comments
 (0)