Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
Removing unnecessary calls to NSUserDefaults synchronize
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Mar 6, 2014
1 parent 76723c8 commit 8de1b51
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions SkyLab/SkyLab.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ + (void)splitTestWithName:(NSString *)name
}

[[NSUserDefaults standardUserDefaults] setObject:choice forKey:SLUserDefaultsKeyForTestName(name)];
[[NSUserDefaults standardUserDefaults] synchronize];


NSDictionary *userInfo = [NSDictionary dictionaryWithObject:choice forKey:SkyLabChoiceKey];

[[NSNotificationCenter defaultCenter] postNotificationName:SkyLabWillRunTestNotification object:name userInfo:userInfo];
Expand Down Expand Up @@ -174,8 +173,7 @@ + (void)multivariateTestWithName:(NSString *)name
}

[[NSUserDefaults standardUserDefaults] setObject:[activeVariables allObjects] forKey:SLUserDefaultsKeyForTestName(name)];
[[NSUserDefaults standardUserDefaults] synchronize];


NSDictionary *userInfo = [NSDictionary dictionaryWithObject:activeVariables forKey:SkyLabActiveVariablesKey];

[[NSNotificationCenter defaultCenter] postNotificationName:SkyLabWillRunTestNotification object:name userInfo:userInfo];
Expand All @@ -185,7 +183,6 @@ + (void)multivariateTestWithName:(NSString *)name

+ (void)resetTestNamed:(NSString *)name {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:SLUserDefaultsKeyForTestName(name)];
[[NSUserDefaults standardUserDefaults] synchronize];

[[NSNotificationCenter defaultCenter] postNotificationName:SkyLabDidResetTestNotification object:name];
}
Expand Down

0 comments on commit 8de1b51

Please sign in to comment.