@@ -86,7 +86,7 @@ - (BNCServerRequest *)removeAt:(unsigned int)index {
8686 BNCLogError (@" Invalid queue operation: index out of bound!" );
8787 return nil ;
8888 }
89-
89+
9090 request = [self .queue objectAtIndex: index];
9191 [self .queue removeObjectAtIndex: index];
9292 [self persistEventually ];
@@ -111,10 +111,10 @@ - (BNCServerRequest *)peekAt:(unsigned int)index {
111111 BNCLogError (@" Invalid queue operation: index out of bound!" );
112112 return nil ;
113113 }
114-
114+
115115 BNCServerRequest *request = nil ;
116116 request = [self .queue objectAtIndex: index];
117-
117+
118118 return request;
119119 }
120120}
@@ -176,7 +176,7 @@ - (BranchOpenRequest *)moveInstallOrOpenToFront:(NSInteger)networkCount {
176176 for (int i = 0 ; i < self.queue .count ; i++) {
177177 BNCServerRequest *req = [self .queue objectAtIndex: i];
178178 if ([req isKindOfClass: [BranchOpenRequest class ]]) {
179-
179+
180180 // Already in front, nothing to do
181181 if (i == 0 || (i == 1 && requestAlreadyInProgress)) {
182182 return (BranchOpenRequest *)req;
@@ -187,19 +187,19 @@ - (BranchOpenRequest *)moveInstallOrOpenToFront:(NSInteger)networkCount {
187187 break ;
188188 }
189189 }
190-
190+
191191 if (!openOrInstallRequest) {
192192 BNCLogError (@" No install or open request in queue while trying to move it to the front." );
193193 return nil ;
194194 }
195-
195+
196196 if (!requestAlreadyInProgress || !self.queue .count ) {
197197 [self insert: openOrInstallRequest at: 0 ];
198198 }
199199 else {
200200 [self insert: openOrInstallRequest at: 1 ];
201201 }
202-
202+
203203 return (BranchOpenRequest *)openOrInstallRequest;
204204 }
205205}
@@ -233,9 +233,9 @@ - (void)persistEventually {
233233 BNCNanoSecondsFromTimeInterval (BATCH_WRITE_TIMEOUT),
234234 BNCNanoSecondsFromTimeInterval (BATCH_WRITE_TIMEOUT / 10.0 )
235235 );
236- __weak typeof (self) weakSelf = self;
236+ __weak __typeof (self) weakSelf = self;
237237 dispatch_source_set_event_handler (self.persistTimer , ^ {
238- __strong typeof (self) strongSelf = weakSelf;
238+ __strong __typeof (self) strongSelf = weakSelf;
239239 if (strongSelf) {
240240 [strongSelf persistImmediately ];
241241 dispatch_source_cancel (strongSelf.persistTimer );
@@ -290,7 +290,7 @@ - (void)retrieve {
290290 @synchronized (self) {
291291 NSMutableArray *queue = [[NSMutableArray alloc ] init ];
292292 NSArray *encodedRequests = nil ;
293-
293+
294294 // Capture exception while loading the queue file
295295 @try {
296296 NSError *error = nil ;
@@ -325,21 +325,21 @@ - (void)retrieve {
325325 BNCLogWarning (@" An exception occurred while attempting to parse a queued request, discarding." );
326326 continue ;
327327 }
328-
328+
329329 // Throw out invalid request types
330330 if (![request isKindOfClass: [BNCServerRequest class ]]) {
331331 BNCLogWarning (@" Found an invalid request object, discarding. Object is: %@ ." , request);
332332 continue ;
333333 }
334-
334+
335335 // Throw out persisted close requests
336336 if ([request isKindOfClass: [BranchCloseRequest class ]]) {
337337 continue ;
338338 }
339339
340340 [queue addObject: request];
341341 }
342-
342+
343343 self.queue = queue;
344344 }
345345}
@@ -367,9 +367,9 @@ + (NSURL* _Nonnull) URLForQueueFile {
367367+ (void ) moveOldQueueFile {
368368 NSURL *oldURL = [NSURL fileURLWithPath: self .queueFile_deprecated];
369369 NSURL *newURL = [self URLForQueueFile ];
370-
370+
371371 if (!oldURL || !newURL) { return ; }
372-
372+
373373 NSError *error = nil ;
374374 [[NSFileManager defaultManager ]
375375 moveItemAtURL: oldURL
@@ -398,7 +398,7 @@ + (void) initialize {
398398+ (id )getInstance {
399399 static BNCServerRequestQueue *sharedQueue = nil ;
400400 static dispatch_once_t onceToken;
401-
401+
402402 dispatch_once (&onceToken, ^ {
403403 sharedQueue = [[BNCServerRequestQueue alloc ] init ];
404404 [sharedQueue retrieve ];
0 commit comments