Skip to content

Commit 7ad4543

Browse files
committed
Port code review changes from google3
1 parent fb9639a commit 7ad4543

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

GoogleUtilities/Network/GULNetworkURLSession.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,14 @@ - (void)URLSession:(NSURLSession *)session
294294
[self maybeRemoveTempFilesAtURL:_networkDirectoryURL
295295
expiringTime:kGULNetworkTempFolderExpireTime];
296296

297-
NSString *sessionID = session.configuration.identifier;
298-
299297
// This is called without checking the sessionID here since non-background sessions
300298
// won't have an ID.
301299
[session finishTasksAndInvalidate];
302300

303301
// Explicitly remove the session so it won't be reused. The weak map table should
304302
// remove the session on deallocation, but dealloc may not happen immediately after
305303
// calling `finishTasksAndInvalidate`.
304+
NSString *sessionID = session.configuration.identifier;
306305
[[self class] setSessionInFetcherMap:nil forSessionID:sessionID];
307306
}
308307

@@ -688,7 +687,7 @@ + (void)setSessionInFetcherMap:(GULNetworkURLSession *)session forSessionID:(NSS
688687
GULNetworkURLSession *existingSession =
689688
[[[self class] sessionIDToFetcherMap] objectForKey:sessionID];
690689
if (existingSession) {
691-
if (session != nil) {
690+
if (session) {
692691
NSString *message = [NSString stringWithFormat:@"Discarding session: %@", existingSession];
693692
[existingSession->_loggerDelegate GULNetwork_logWithLevel:kGULNetworkLogLevelInfo
694693
messageCode:kGULNetworkMessageCodeURLSession019

0 commit comments

Comments
 (0)