* Source/NSPasteboard.m (-_pasteboardWithTarget:name:): Correct

wrong order of arguments to NSMapInsert.
* Source/NSPasteboard.m (-generalPasteboard): Simplify
implementation.
This commit is contained in:
Fred Kiefer 2021-02-21 20:45:56 +01:00
parent 1c972d2892
commit 48a03d8b8f
2 changed files with 9 additions and 11 deletions

View file

@ -1095,16 +1095,7 @@ static NSMapTable *mimeMap = NULL;
*/
+ (NSPasteboard*) generalPasteboard
{
static NSPasteboard *generalPboard = nil;
NSPasteboard *currentGeneralPboard;
// call pasteboardWithName: every time, to update server connection if needed
currentGeneralPboard = [self pasteboardWithName: NSGeneralPboard];
if (currentGeneralPboard != generalPboard)
{
ASSIGN(generalPboard, currentGeneralPboard);
}
return generalPboard;
return [self pasteboardWithName: NSGeneralPboard];
}
+ (void) initialize
@ -2138,7 +2129,7 @@ description, [cmd stringByDeletingLastPathComponent]);
{
ASSIGN(p->target, (id)aTarget);
ASSIGNCOPY(p->name, aName);
NSMapInsert(pasteboards, (void*)p, (void*)p->name);
NSMapInsert(pasteboards, (void*)p->name, (void*)p);
[p autorelease];
}
}