Revision: 29570
          http://sourceforge.net/p/bibdesk/svn/29570
Author:   hofman
Date:     2025-09-10 14:44:31 +0000 (Wed, 10 Sep 2025)
Log Message:
-----------
get indexes of downloads to remove

Modified Paths:
--------------
    trunk/bibdesk/BDSKDownloadManager.m

Modified: trunk/bibdesk/BDSKDownloadManager.m
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.m 2025-09-09 16:31:45 UTC (rev 29569)
+++ trunk/bibdesk/BDSKDownloadManager.m 2025-09-10 14:44:31 UTC (rev 29570)
@@ -134,16 +134,11 @@
 }
 
 - (void)clear {
-    BOOL didRemove = NO;
-    NSUInteger i = [downloads count];
-    while (i--) {
-        if ([[downloads objectAtIndex:i] status] != 
BDSKDownloadStatusDownloading) {
-            [downloads removeObjectAtIndex:i];
-            didRemove = YES;
-        }
+    NSIndexSet *indexes = [downloads 
indexesOfObjectsPassingTest:^BOOL(BDSKWebDownload *download, NSUInteger i, BOOL 
*stop){ return [download status] != BDSKDownloadStatusDownloading; }];
+    if ([indexes count]) {
+        [downloads removeObjectsAtIndexes:indexes];
+        [self notifyUpdate];
     }
-    if (didRemove)
-        [self notifyUpdate];
 }
 
 - (void)cancel:(NSInteger)uniqueID {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to