Revision: 29917
          http://sourceforge.net/p/bibdesk/svn/29917
Author:   hofman
Date:     2025-11-30 17:39:04 +0000 (Sun, 30 Nov 2025)
Log Message:
-----------
no need to swap arrays twice

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

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2025-11-30 17:16:47 UTC (rev 29916)
+++ trunk/bibdesk/BibDocument_Actions.m 2025-11-30 17:39:04 UTC (rev 29917)
@@ -1702,6 +1702,7 @@
     NSArray *pubs = nil;
 
     if ([self hasGroupTypeSelected:BDSKExternalGroupType]) {
+        // allCandidates should always be YES for external groups
         duplicatePubs = [[NSMutableArray alloc] 
initWithArray:groupedPublications];
         pointerFunctions = [NSPointerFunctions 
itemEquivalencePointerFunctions];
         pubs = [publications copy];
@@ -1718,9 +1719,10 @@
         for (BibItem *pub in uniquePubs)
             [duplicatePubs removeObjectIdenticalTo:pub];
         
-        // original buffer should be large enough, since we've only removed 
items from pubsToRemove
-        pubs = [duplicatePubs copy];
-        [duplicatePubs setArray:publications];
+        if (allCandidates) {
+            pubs = [duplicatePubs copy];
+            [duplicatePubs setArray:publications];
+        }
     }
     
     if (allCandidates) {
@@ -1728,15 +1730,14 @@
         for (BibItem *pub in pubs)
             [removeSet addObject:pub];
 
-        CFIndex idx = [duplicatePubs count];
+        NSUInteger idx = [duplicatePubs count];
         
         while(idx--){
             if([removeSet containsObject:[duplicatePubs objectAtIndex:idx]] == 
NO)
                 [duplicatePubs removeObjectAtIndex:idx];
         }
-    } else {
-        [duplicatePubs setArray:pubs];
     }
+    
     [self selectPublications:duplicatePubs];
     
     if(countOfItems)

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to