Removing synchronize calls as they are async anyway

check http://dscoder.com/defaults.html by the engineer who actually works on NSUserDefaults
This commit is contained in:
Benjamin Scholtysik (Reimold)
2016-09-06 21:34:27 -07:00
parent 3cec0a380d
commit 890e899589
4 changed files with 0 additions and 8 deletions

View File

@@ -960,7 +960,6 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
} else {
[defaults setObject:lastAuthenticatedVersion
forKey:kBITAuthenticatorLastAuthenticatedVersionKey];
[defaults synchronize];
}
}

View File

@@ -521,7 +521,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
// we only need to log this once
if (!_didLogLowMemoryWarning) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppDidReceiveLowMemoryNotification];
[[NSUserDefaults standardUserDefaults] synchronize];
_didLogLowMemoryWarning = YES;
}
}];
@@ -548,7 +547,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
- (void)leavingAppSafely {
if (self.isAppNotTerminatingCleanlyDetectionEnabled) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppWentIntoBackgroundSafely];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
@@ -1274,7 +1272,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
#endif
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kBITAppDidReceiveLowMemoryNotification];
[[NSUserDefaults standardUserDefaults] synchronize];
[self triggerDelayedProcessing];
BITHockeyLogVerbose(@"VERBOSE: CrashManager startManager has finished.");

View File

@@ -118,7 +118,6 @@ static NSString *const BITMetricsURLPathString = @"v2/track";
- (void)updateDidEnterBackgroundTime {
[self.userDefaults setDouble:[[NSDate date] timeIntervalSince1970] forKey:kBITApplicationDidEnterBackgroundTime];
[self.userDefaults synchronize];
}
- (void)startNewSessionIfNeeded {
@@ -150,7 +149,6 @@ static NSString *const BITMetricsURLPathString = @"v2/track";
if (![self.userDefaults boolForKey:kBITApplicationWasLaunched]) {
session.isFirst = @"true";
[self.userDefaults setBool:YES forKey:kBITApplicationWasLaunched];
[self.userDefaults synchronize];
} else {
session.isFirst = @"false";
}

View File

@@ -165,8 +165,6 @@
[self.userDefaults removeObjectForKey:kBITStoreUpdateLastStoreVersion];
versionString = nil;
}
[self.userDefaults synchronize];
}
}