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:
David Chisnall 2009-11-23 23:01:23 +00:00
parent a518eeea1c
commit bf300b6950

View file

@ -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;
}