Revision: 29067
          http://sourceforge.net/p/bibdesk/svn/29067
Author:   hofman
Date:     2025-02-24 22:45:38 +0000 (Mon, 24 Feb 2025)
Log Message:
-----------
use block based indexes

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

Modified: trunk/bibdesk/BDSKErrorObjectController.m
===================================================================
--- trunk/bibdesk/BDSKErrorObjectController.m   2025-02-24 22:22:38 UTC (rev 
29066)
+++ trunk/bibdesk/BDSKErrorObjectController.m   2025-02-24 22:45:38 UTC (rev 
29067)
@@ -322,17 +322,11 @@
 }
 
 - (void)removeErrorsForPublications:(NSArray *)pubs{
-       NSUInteger idx = [self countOfErrors];
-    BibItem *pub;
+    NSIndexSet *indexesToRemove = [errors indexesOfObjectsPassingTest:^BOOL 
(BDSKErrorObject *errObj, NSUInteger i, BOOL *stop){
+            BibItem *pub = [errObj publication];
+            return pub != nil && [pubs containsObject:pub];
+        }];
     
-    NSMutableIndexSet *indexesToRemove = [NSMutableIndexSet indexSet];
-     
-    while (idx--) {
-               pub = [[self objectInErrorsAtIndex:idx] publication];
-        if(pub && [pubs containsObject:pub])
-            [indexesToRemove addIndex:idx];
-    }
-    
     // batch changes
     [self willChange:NSKeyValueChangeRemoval valuesAtIndexes:indexesToRemove 
forKey:@"errors"];
     [errors removeObjectsAtIndexes:indexesToRemove];

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