Skip to content

Commit 133ecbb

Browse files
author
Martin Cowie
committed
Reformat for "house style".
Collapsing two ifs into one.
1 parent 85f9427 commit 133ecbb

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

SocketRocket/SRWebSocket.m

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -659,22 +659,20 @@ - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
659659

660660
[self _sendFrameWithOpcode:SROpCodeConnectionClose data:payload];
661661
});
662-
663-
if(self.closeTimeout != nil) {
664-
__weak SRWebSocket const *weakSelf = self;
665-
dispatch_after(
666-
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.closeTimeout.doubleValue * NSEC_PER_SEC)),
667-
_workQueue,
668-
^{
669-
SRWebSocket const *strongSelf = weakSelf;
670-
if(strongSelf==nil) {
671-
return;
672-
}
673-
if(strongSelf.readyState != SR_CLOSED) {
674-
[strongSelf _disconnect];
675-
}
676-
});
677-
}
662+
663+
if(self.closeTimeout != nil) {
664+
__weak SRWebSocket const *weakSelf = self;
665+
dispatch_after(
666+
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.closeTimeout.doubleValue * NSEC_PER_SEC)),
667+
_workQueue,
668+
^{
669+
SRWebSocket const *strongSelf = weakSelf;
670+
if(strongSelf != nil && strongSelf.readyState != SR_CLOSED) {
671+
[strongSelf _disconnect];
672+
}
673+
}
674+
);
675+
}
678676
}
679677

680678
- (void)_closeWithProtocolError:(NSString *)message;

0 commit comments

Comments
 (0)