Add some comments/nullability annotations for clarity

pull/1/head
Michael Kirk 7 years ago
parent c9218b59ca
commit bfd8eb63c6

@ -188,13 +188,15 @@ static const NSUInteger kMaxPrekeyUpdateFailureCount = 5;
+ (void)clearSignedPreKeyRecords { + (void)clearSignedPreKeyRecords {
OWSPrimaryStorage *primaryStorage = [OWSPrimaryStorage sharedManager]; OWSPrimaryStorage *primaryStorage = [OWSPrimaryStorage sharedManager];
NSNumber *currentSignedPrekeyId = [primaryStorage currentSignedPrekeyId]; NSNumber *_Nullable currentSignedPrekeyId = [primaryStorage currentSignedPrekeyId];
[self clearSignedPreKeyRecordsWithKeyId:currentSignedPrekeyId]; [self clearSignedPreKeyRecordsWithKeyId:currentSignedPrekeyId];
} }
+ (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *)keyId + (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *_Nullable)keyId
{ {
if (!keyId) { if (!keyId) {
// currentSignedPreKeyId should only be nil before we've completed registration.
// We have this guard here for robustness, but we should never get here.
OWSFailDebug(@"Ignoring request to clear signed preKeys since no keyId was specified"); OWSFailDebug(@"Ignoring request to clear signed preKeys since no keyId was specified");
return; return;
} }

Loading…
Cancel
Save