mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Replaced two superfluous NSInvocation construction occurrences with direct calls to the IMP in question. According to Riccardo 'it is really snappier in most user operations'.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29050 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a518eeea1c
commit
bf300b6950
1 changed files with 12 additions and 24 deletions
|
@ -2173,18 +2173,12 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
|||
|
||||
if (resp != nil)
|
||||
{
|
||||
NSInvocation *inv;
|
||||
NSMethodSignature *sig;
|
||||
|
||||
sig = [resp methodSignatureForSelector: aSelector];
|
||||
inv = [NSInvocation invocationWithMethodSignature: sig];
|
||||
[inv setSelector: aSelector];
|
||||
if ([sig numberOfArguments] > 2)
|
||||
{
|
||||
[inv setArgument: &sender atIndex: 2];
|
||||
}
|
||||
[inv invokeWithTarget: resp];
|
||||
return YES;
|
||||
IMP actionIMP = [resp methodForSelector: aSelector];
|
||||
if (0 != actionIMP)
|
||||
{
|
||||
actionIMP(resp, aSelector, sender);
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
|
@ -2260,18 +2254,12 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
|||
}
|
||||
if (_delegate != nil && [_delegate respondsToSelector: aSelector])
|
||||
{
|
||||
NSInvocation *inv;
|
||||
NSMethodSignature *sig;
|
||||
|
||||
sig = [_delegate methodSignatureForSelector: aSelector];
|
||||
inv = [NSInvocation invocationWithMethodSignature: sig];
|
||||
[inv setSelector: aSelector];
|
||||
if ([sig numberOfArguments] > 2)
|
||||
{
|
||||
[inv setArgument: &anObject atIndex: 2];
|
||||
}
|
||||
[inv invokeWithTarget: _delegate];
|
||||
return YES;
|
||||
IMP actionIMP = [_delegate methodForSelector: aSelector];
|
||||
if (0 != actionIMP)
|
||||
{
|
||||
actionIMP(_delegate, aSelector, anObject);
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue