mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Simplification of some invocation code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30531 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b326d69195
commit
775dd86b02
1 changed files with 2 additions and 14 deletions
|
@ -534,15 +534,11 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
SEL selector;
|
||||
GSFFIInvocation *invocation;
|
||||
NSMethodSignature *sig;
|
||||
GSMethod fwdInvMethod;
|
||||
|
||||
obj = *(id *)args[0];
|
||||
selector = *(SEL *)args[1];
|
||||
|
||||
fwdInvMethod = gs_method_for_receiver_and_selector
|
||||
(obj, @selector (forwardInvocation:));
|
||||
|
||||
if (!fwdInvMethod)
|
||||
if (!class_respondsToSelector(obj->class_pointer, @selector(forwardInvocation:)))
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"GSFFIInvocation: Class '%s'(%s) does not respond"
|
||||
|
@ -625,15 +621,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
[invocation setTarget: obj];
|
||||
[invocation setSelector: selector];
|
||||
|
||||
/*
|
||||
* Now do it.
|
||||
* The next line is equivalent to
|
||||
*
|
||||
* [obj forwardInvocation: invocation];
|
||||
*
|
||||
* but we have already the GSMethod for forwardInvocation
|
||||
* so the line below is somewhat faster. */
|
||||
fwdInvMethod->method_imp (obj, fwdInvMethod->method_name, invocation);
|
||||
[obj forwardInvocation: invocation];
|
||||
|
||||
/* If we are returning a value, we must copy it from the invocation
|
||||
* to the memory indicated by 'retp'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue