Revision: 28524
          http://sourceforge.net/p/bibdesk/svn/28524
Author:   hofman
Date:     2024-01-03 17:51:39 +0000 (Wed, 03 Jan 2024)
Log Message:
-----------
Get callbacks/pointerfunctions separately, add comment

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

Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m  2024-01-03 17:41:17 UTC (rev 28523)
+++ trunk/bibdesk/BibDocument_Groups.m  2024-01-03 17:51:39 UTC (rev 28524)
@@ -466,19 +466,20 @@
     NSString *groupField = [parent key];
     BOOL isPersonField = [groupField isPersonField];
     
-    NSHashTable *hashTable;
-    CFMutableBagRef bag;
+    // No NSHashTable variant of NSCountedSet exists, so we use CFMutableBag
+    NSPointerFunctions *pointerFunctions = nil;
     CFBagCallBacks bagCallBacks = kCFTypeBagCallBacks;
     if(isPersonField) {
-        hashTable = [[NSHashTable alloc] 
initWithPointerFunctions:[NSPointerFunctions fuzzyAuthorPointerFunctions] 
capacity:0];
+        pointerFunctions = [NSPointerFunctions fuzzyAuthorPointerFunctions];
+        bagCallBacks.equal = BibAuthorFuzzyEqual;
+        bagCallBacks.hash = BibAuthorFuzzyHash;
+    } else {
+        pointerFunctions = [NSPointerFunctions 
caseInsensitiveStringPointerFunctions];
         bagCallBacks.equal = BDSKCaseInsensitiveStringEqual;
         bagCallBacks.hash = BDSKCaseInsensitiveStringHash;
-    } else {
-        hashTable = [[NSHashTable alloc] 
initWithPointerFunctions:[NSPointerFunctions 
caseInsensitiveStringPointerFunctions] capacity:0];
-        bagCallBacks.equal = BibAuthorFuzzyEqual;
-        bagCallBacks.hash = BibAuthorFuzzyHash;
     }
-    bag = CFBagCreateMutable(kCFAllocatorDefault, 0, &bagCallBacks);
+    NSHashTable *hashTable = [[NSHashTable alloc] 
initWithPointerFunctions:pointerFunctions capacity:0];
+    CFMutableBagRef bag = CFBagCreateMutable(kCFAllocatorDefault, 0, 
&bagCallBacks);
     
     NSArray *oldGroups = [parent categoryGroups];
     BDSKCategoryGroup *group = [oldGroups firstObject];

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